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