| 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
| 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 5 | |
| 6 | gTestfile = 'constructor-001.js'; |
| 7 | |
| 8 | /** |
| 9 | * File Name: RegExp/constructor-001.js |
| 10 | * ECMA Section: 15.7.3.3 |
| 11 | * Description: Based on ECMA 2 Draft 7 February 1999 |
| 12 | * |
| 13 | * Author: [email protected] |
| 14 | * Date: 19 February 1999 |
| 15 | */ |
| 16 | var SECTION = "RegExp/constructor-001"; |
| 17 | var VERSION = "ECMA_2"; |
| 18 | var TITLE = "new RegExp()"; |
| 19 | |
| 20 | startTest(); |
| 21 | |
| 22 | /* |
| 23 | * for each test case, verify: |
| 24 | * - verify that [[Class]] property is RegExp |
| 25 | * - prototype property should be set to RegExp.prototype |
| 26 | * - source is set to the empty string |
| 27 | * - global property is set to false |
| 28 | * - ignoreCase property is set to false |
| 29 | * - multiline property is set to false |
| 30 | * - lastIndex property is set to 0 |
| 31 | */ |
| 32 | |
| 33 | RegExp.prototype.getClassProperty = Object.prototype.toString; |
| 34 | var re = new RegExp(); |
| 35 | |
| 36 | AddTestCase( |
| 37 | "new RegExp().__proto__", |
| 38 | RegExp.prototype, |
| 39 | re.__proto__ |
| 40 | ); |
| 41 | |
| 42 | test() |