js/src/tests/ecma_2/Exceptions/lexical-004.js

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:ad035e923b94
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
7 /**
8 File Name: lexical-004.js
9 Corresponds To: ecma/LexicalExpressions/7.4.1-1-n.js
10 ECMA Section: 7.4.1
11
12 Description:
13
14 Reserved words cannot be used as identifiers.
15
16 ReservedWord ::
17 Keyword
18 FutureReservedWord
19 NullLiteral
20 BooleanLiteral
21
22 Author: christine@netscape.com
23 Date: 12 november 1997
24
25 */
26 var SECTION = "lexical-004";
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("var null = true;");
39 } catch ( e ) {
40 result = expect;
41 exception = e.toString();
42 }
43
44 new TestCase(
45 SECTION,
46 "var null = true" +
47 " (threw " + exception +")",
48 expect,
49 result );
50
51 test();
52

mercurial