* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / Microsoft.JScript / Test / Mozilla / ecma_2 / Exceptions / function-001.js
1 /**
2  *  File Name:          boolean-001.js
3  *  Description:
4  *
5  *  http://scopus.mcom.com/bugsplat/show_bug.cgi?id=99232
6  *
7  *  eval("function f(){}function g(){}") at top level is an error for JS1.2
8  *     and above (missing ; between named function expressions), but declares f
9  *     and g as functions below 1.2.
10  *
11  * Fails to produce error regardless of version:
12  * js> version(100)
13  * 120
14  * js> eval("function f(){}function g(){}")
15  * js> version(120);
16  * 100
17  * js> eval("function f(){}function g(){}")
18  * js>
19  *  Author:             christine@netscape.com
20  *  Date:               11 August 1998
21  */
22     var SECTION = "function-001.js";
23     var VERSION = "JS_12";
24     var TITLE   = "functions not separated by semicolons are errors in version 120 and higher";
25     var BUGNUMBER="10278";
26
27     startTest();
28     writeHeaderToLog( SECTION + " "+ TITLE);
29
30     var result = "fail";
31     var exception = "no exception thrown";
32
33     try {
34         eval("function f(){}function g(){}");
35     } catch ( e ) {
36         result = "pass"
37         exception = e.toString();
38     }
39
40     new TestCase(
41         SECTION,
42         "eval(\"function f(){}function g(){}\") (threw "+exception,
43         "pass",
44         result );
45
46     test();
47