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