Debian Codegraph @

rhino/testsrc/tests/ecma_2/RegExp/function-001.js

raw symbols SCIP
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 = 'function-001.js';
7
8 /**
9 * File Name: RegExp/function-001.js
10 * ECMA Section: 15.7.2.1
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/function-001";
17 var VERSION = "ECMA_2";
18 var TITLE = "RegExp( pattern, flags )";
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 "RegExp.prototype.getClassProperty = Object.prototype.toString; " +
38 "(new RegExp()).getClassProperty()",
39 "[object RegExp]",
40 re.getClassProperty() );
41
42 AddTestCase(
43 "(new RegExp()).source",
44 "",
45 re.source );
46
47 AddTestCase(
48 "(new RegExp()).global",
49 false,
50 re.global );
51
52 AddTestCase(
53 "(new RegExp()).ignoreCase",
54 false,
55 re.ignoreCase );
56
57 AddTestCase(
58 "(new RegExp()).multiline",
59 false,
60 re.multiline );
61
62 AddTestCase(
63 "(new RegExp()).lastIndex",
64 0,
65 re.lastIndex );
66
67 test()