Debian Codegraph @

rhino/testsrc/tests/ecma_2/Exceptions/lexical-021.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 = 'lexical-021.js';
7
8 /**
9 File Name: lexical-021.js
10 Corresponds To: 7.4.3-14-n.js
11 ECMA Section: 7.4.3
12
13 Description:
14 The following words are used as keywords in proposed extensions and are
15 therefore reserved to allow for the possibility of future adoption of
16 those extensions.
17
18 FutureReservedWord :: one of
19 case debugger export super
20 catch default extends switch
21 class do finally throw
22 const enum import try
23
24 Author: [email protected]
25 Date: 12 november 1997
26 */
27 var SECTION = "lexical-021.js";
28 var VERSION = "ECMA_1";
29 var TITLE = "Future Reserved Words";
30
31 startTest();
32 writeHeaderToLog( SECTION + " "+ TITLE);
33
34 print("This test requires option javascript.options.strict enabled");
35
36 if (!options().match(/strict/))
37 {
38 options('strict');
39 }
40 if (!options().match(/werror/))
41 {
42 options('werror');
43 }
44
45 var result = "Failed";
46 var exception = "No exception thrown";
47 var expect = "Passed";
48
49 try {
50 eval("enum = true;");
51 } catch ( e ) {
52 result = expect;
53 exception = e.toString();
54 }
55
56 new TestCase(
57 SECTION,
58 "enum = true" +
59 " (threw " + exception +")",
60 expect,
61 result );
62
63 test();