]>
Commit | Line | Data |
---|---|---|
b37bf2e1 A |
1 | /** |
2 | File Name: lexical-029.js | |
3 | Corresponds To: 7.4.2-6.js | |
4 | ECMA Section: 7.4.2 | |
5 | ||
6 | Description: | |
7 | The following tokens are ECMAScript keywords and may not be used as | |
8 | identifiers in ECMAScript programs. | |
9 | ||
10 | Syntax | |
11 | ||
12 | Keyword :: one of | |
13 | break for new var | |
14 | continue function return void | |
15 | delete if this while | |
16 | else in typeof with | |
17 | ||
18 | This test verifies that the keyword cannot be used as an identifier. | |
19 | Functioinal tests of the keyword may be found in the section corresponding | |
20 | to the function of the keyword. | |
21 | ||
22 | Author: christine@netscape.com | |
23 | Date: 12 november 1997 | |
24 | ||
25 | */ | |
26 | var SECTION = "lexical-029"; | |
27 | var VERSION = "JS1_4"; | |
28 | var TITLE = "Keywords"; | |
29 | ||
30 | startTest(); | |
31 | writeHeaderToLog( SECTION + " "+ TITLE); | |
32 | ||
33 | var tc = 0; | |
34 | var testcases = new Array(); | |
35 | ||
36 | var result = "Failed"; | |
37 | var exception = "No exception thrown"; | |
38 | var expect = "Passed"; | |
39 | ||
40 | try { | |
41 | eval("var function = true;"); | |
42 | } catch ( e ) { | |
43 | result = expect; | |
44 | exception = e.toString(); | |
45 | } | |
46 | ||
47 | testcases[tc++] = new TestCase( | |
48 | SECTION, | |
49 | "var function = true" + | |
50 | " (threw " + exception +")", | |
51 | expect, | |
52 | result ); | |
53 | ||
54 | test(); | |
55 | ||
56 |