initial import
[vuplus_webkit] / Source / JavaScriptCore / tests / mozilla / ecma_2 / Exceptions / lexical-004.js
1 /**
2     File Name:          lexical-004.js
3     Corresponds To:     ecma/LexicalExpressions/7.4.1-1-n.js
4     ECMA Section:       7.4.1
5
6     Description:
7
8     Reserved words cannot be used as identifiers.
9
10     ReservedWord ::
11     Keyword
12     FutureReservedWord
13     NullLiteral
14     BooleanLiteral
15
16     Author:             christine@netscape.com
17     Date:               12 november 1997
18
19 */
20     var SECTION = "lexical-004";
21     var VERSION = "JS1_4";
22     var TITLE   = "Keywords";
23
24     startTest();
25     writeHeaderToLog( SECTION + " "+ TITLE);
26
27     var tc = 0;
28     var testcases = new Array();
29
30     var result = "Failed";
31     var exception = "No exception thrown";
32     var expect = "Passed";
33
34     try {
35         eval("var null = true;");
36     } catch ( e ) {
37         result = expect;
38         exception = e.toString();
39     }
40
41     testcases[tc++] = new TestCase(
42         SECTION,
43         "var null = true" +
44         " (threw " + exception +")",
45         expect,
46         result );
47
48     test();
49