]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma_2/Statements/try-003.js
2 * File Name: try-003.js
4 * Description: The try statement
6 * This test has a try with no catch, and a finally.
8 * Author: christine@netscape.com
11 var SECTION
= "try-003";
12 var VERSION
= "ECMA_2";
13 var TITLE
= "The try statement";
14 var BUGNUMBER
="http://scopus.mcom.com/bugsplat/show_bug.cgi?id=313585";
17 writeHeaderToLog( SECTION
+ " "+ TITLE
);
20 var testcases
= new Array();
24 TrySomething( "x = \"hi\"", false );
25 TrySomething( "throw \"boo\"", true );
26 TrySomething( "throw 3", true );
31 * This function contains a try block with no catch block,
32 * but it does have a finally block. Try to evaluate expressions
33 * that do and do not throw exceptions.
36 function TrySomething( expression
, throwing
) {
37 innerFinally
= "FAIL: DID NOT HIT INNER FINALLY BLOCK";
39 outerCatch
= "FAILED: NO EXCEPTION CAUGHT";
43 outerFinally
= "FAIL: DID NOT HIT OUTER FINALLY BLOCK";
49 innerFinally
= "PASS";
55 outerCatch
= "FAIL: HIT OUTER CATCH BLOCK";
58 outerFinally
= "PASS";
62 testcases
[tc
++] = new TestCase(
64 "eval( " + expression
+" )",
67 testcases
[tc
++] = new TestCase(
69 "eval( " + expression
+" )",
72 testcases
[tc
++] = new TestCase(
74 "eval( " + expression
+" )",