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