]>
Commit | Line | Data |
---|---|---|
b37bf2e1 A |
1 | /** |
2 | File Name: lexical-054.js | |
3 | Corresponds to: 7.8.2-7-n.js | |
4 | ECMA Section: 7.8.2 Examples of Automatic Semicolon Insertion | |
5 | Description: compare some specific examples of the automatic | |
6 | insertion rules in the EMCA specification. | |
7 | Author: christine@netscape.com | |
8 | Date: 15 september 1997 | |
9 | */ | |
10 | ||
11 | var SECTION = "lexical-054"; | |
12 | var VERSION = "JS1_4"; | |
13 | var TITLE = "Examples of Automatic Semicolon Insertion"; | |
14 | ||
15 | startTest(); | |
16 | writeHeaderToLog( SECTION + " "+ TITLE); | |
17 | ||
18 | var tc = 0; | |
19 | var testcases = new Array(); | |
20 | ||
21 | var result = "Failed"; | |
22 | var exception = "No exception thrown"; | |
23 | var expect = "Passed"; | |
24 | ||
25 | try { | |
26 | a=0; | |
27 | b=1; | |
28 | c=2; | |
29 | d=3; | |
30 | eval("if (a > b)\nelse c = d"); | |
31 | } catch ( e ) { | |
32 | result = expect; | |
33 | exception = e.toString(); | |
34 | } | |
35 | ||
36 | testcases[tc++] = new TestCase( | |
37 | SECTION, | |
38 | "if (a > b)\nelse c = d" + | |
39 | " (threw " + exception +")", | |
40 | expect, | |
41 | result ); | |
42 | ||
43 | test(); |