Debian Codegraph @

rhino/testsrc/tests/ecma_2/Exceptions/lexical-007.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-007.js';
7
8 /**
9 File Name: lexical-005.js
10 Corresponds To: 7.4.1-3-n.js
11 ECMA Section: 7.4.1
12
13 Description:
14
15 Reserved words cannot be used as identifiers.
16
17 ReservedWord ::
18 Keyword
19 FutureReservedWord
20 NullLiteral
21 BooleanLiteral
22
23 Author: [email protected]
24 Date: 12 november 1997
25 */
26 var SECTION = "lexical-005";
27 var VERSION = "JS1_4";
28 var TITLE = "Keywords";
29
30 startTest();
31 writeHeaderToLog( SECTION + " "+ TITLE);
32
33 var result = "Failed";
34 var exception = "No exception thrown";
35 var expect = "Passed";
36
37 try {
38 eval("false = true;");
39 } catch ( e ) {
40 result = expect;
41 exception = e.toString();
42 }
43
44 new TestCase(
45 SECTION,
46 "false = true" +
47 " (threw " + exception +")",
48 expect,
49 result );
50
51 test();
52