Debian Codegraph @

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