Debian Codegraph @

rhino/testsrc/tests/ecma_2/Exceptions/lexical-005.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-005.js';
7
8 /**
9 File Name: lexical-005.js
10 Corresponds To: 7.4.1-2.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 */
27 var SECTION = "lexical-005";
28 var VERSION = "JS1_4";
29 var TITLE = "Keywords";
30
31 startTest();
32 writeHeaderToLog( SECTION + " "+ TITLE);
33
34 var result = "Failed";
35 var exception = "No exception thrown";
36 var expect = "Passed";
37
38 try {
39 eval("true = false;");
40 } catch ( e ) {
41 result = expect;
42 exception = e.toString();
43 }
44
45 new TestCase(
46 SECTION,
47 "true = false" +
48 " (threw " + exception +")",
49 expect,
50 result );
51
52 test();
53