Debian Codegraph @

rhino/testsrc/tests/ecma_2/LexicalConventions/regexp-literals-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 = 'regexp-literals-001.js';
7
8 /**
9 * File Name: LexicalConventions/regexp-literals-001.js
10 * ECMA Section: 7.8.5
11 * Description:
12 *
13 *
14 * Author: [email protected]
15 * Date: 11 August 1998
16 */
17 var SECTION = "LexicalConventions/regexp-literals-001.js";
18 var VERSION = "ECMA_2";
19 var TITLE = "Regular Expression Literals";
20
21 startTest();
22
23 // Regular Expression Literals may not be empty; // should be regarded
24 // as a comment, not a RegExp literal.
25
26 s = //;
27
28 "passed";
29
30 AddTestCase(
31 "// should be a comment, not a regular expression literal",
32 "passed",
33 String(s));
34
35 AddTestCase(
36 "// typeof object should be type of object declared on following line",
37 "passed",
38 (typeof s) == "string" ? "passed" : "failed" );
39
40 AddTestCase(
41 "// should not return an object of the type RegExp",
42 "passed",
43 (typeof s == "object") ? "failed" : "passed" );
44
45 test();