]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma_2/Exceptions/lexical-002.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / mozilla / ecma_2 / Exceptions / lexical-002.js
1 /**
2 File Name: lexical-002.js
3 Corresponds To: ecma/LexicalConventions/7.2-3-n.js
4 ECMA Section: 7.2 Line Terminators
5 Description: - readability
6 - separate tokens
7 - may occur between any two tokens
8 - cannot occur within any token, not even a string
9 - affect the process of automatic semicolon insertion.
10
11 white space characters are:
12 unicode name formal name string representation
13 \u000A line feed <LF> \n
14 \u000D carriage return <CR> \r
15
16 this test uses onerror to capture line numbers. because
17 we use on error, we can only have one test case per file.
18
19 Author: christine@netscape.com
20 Date: 11 september 1997
21 */
22 var SECTION = "lexical-002";
23 var VERSION = "JS1_4";
24 var TITLE = "Line Terminators";
25
26 startTest();
27 writeHeaderToLog( SECTION + " "+ TITLE);
28
29 var tc = 0;
30 var testcases = new Array();
31
32 var result = "Failed";
33 var exception = "No exception thrown";
34 var expect = "Passed";
35
36 try {
37 result = eval("\r\n\expect");
38 } catch ( e ) {
39 exception = e.toString();
40 }
41
42 testcases[tc++] = new TestCase(
43 SECTION,
44 "result=eval(\"\r\nexpect\")" +
45 " (threw " + exception +")",
46 expect,
47 result );
48
49 test();