michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: /** michael@0: * File Name: RegExp/function-001.js michael@0: * ECMA Section: 15.7.2.1 michael@0: * Description: Based on ECMA 2 Draft 7 February 1999 michael@0: * michael@0: * Author: christine@netscape.com michael@0: * Date: 19 February 1999 michael@0: */ michael@0: var SECTION = "RegExp/function-001"; michael@0: var VERSION = "ECMA_2"; michael@0: var TITLE = "RegExp( pattern, flags )"; michael@0: michael@0: startTest(); michael@0: michael@0: /* michael@0: * for each test case, verify: michael@0: * - verify that [[Class]] property is RegExp michael@0: * - prototype property should be set to RegExp.prototype michael@0: * - source is set to the empty string michael@0: * - global property is set to false michael@0: * - ignoreCase property is set to false michael@0: * - multiline property is set to false michael@0: * - lastIndex property is set to 0 michael@0: */ michael@0: michael@0: RegExp.prototype.getClassProperty = Object.prototype.toString; michael@0: var re = new RegExp(); michael@0: michael@0: AddTestCase( michael@0: "RegExp.prototype.getClassProperty = Object.prototype.toString; " + michael@0: "(new RegExp()).getClassProperty()", michael@0: "[object RegExp]", michael@0: re.getClassProperty() ); michael@0: michael@0: AddTestCase( michael@0: "(new RegExp()).source", michael@0: "", michael@0: re.source ); michael@0: michael@0: AddTestCase( michael@0: "(new RegExp()).global", michael@0: false, michael@0: re.global ); michael@0: michael@0: AddTestCase( michael@0: "(new RegExp()).ignoreCase", michael@0: false, michael@0: re.ignoreCase ); michael@0: michael@0: AddTestCase( michael@0: "(new RegExp()).multiline", michael@0: false, michael@0: re.multiline ); michael@0: michael@0: AddTestCase( michael@0: "(new RegExp()).lastIndex", michael@0: 0, michael@0: re.lastIndex ); michael@0: michael@0: test()