]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma_2/Exceptions/statement-009.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / mozilla / ecma_2 / Exceptions / statement-009.js
1 /**
2 File Name: 12.9-1-n.js
3 ECMA Section: 12.9 The return statement
4 Description:
5
6 Author: christine@netscape.com
7 Date: 12 november 1997
8 */
9 var SECTION = "12.9-1-n";
10 var VERSION = "ECMA_1";
11 var TITLE = "The return statment";
12
13 startTest();
14 writeHeaderToLog( SECTION + " The return statement");
15
16 var tc = 0;
17 var testcases = new Array();
18
19 var result = "Failed";
20 var exception = "No exception thrown";
21 var expect = "Passed";
22
23 try {
24 eval("return;");
25 } catch ( e ) {
26 result = expect;
27 exception = e.toString();
28 }
29
30 testcases[tc++] = new TestCase(
31 SECTION,
32 "return outside of a function" +
33 " (threw " + exception +")",
34 expect,
35 result );
36
37 test();
38