Debian Codegraph @

rhino/testsrc/tests/ecma_2/LexicalConventions/keywords-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 = 'keywords-001.js';
7
8 /**
9 * File Name:
10 * ECMA Section:
11 * Description:
12 *
13 *
14 * Author: [email protected]
15 * Date: 11 August 1998
16 */
17 var SECTION = "";
18 var VERSION = "ECMA_2";
19 var TITLE = "Keywords";
20
21 startTest();
22
23 print("This test requires option javascript.options.strict enabled");
24
25 if (!options().match(/strict/))
26 {
27 options('strict');
28 }
29 if (!options().match(/werror/))
30 {
31 options('werror');
32 }
33
34 var result = "failed";
35
36 try {
37 eval("super;");
38 }
39 catch (x) {
40 if (x instanceof SyntaxError)
41 result = x.name;
42 }
43
44 AddTestCase(
45 "using the expression \"super\" shouldn't cause js to crash",
46 "SyntaxError",
47 result );
48
49 test();