]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma_2/Statements/try-010.js
2 * File Name: try-010.js
4 * Description: The try statement
6 * This has a try block nested in the try block. Verify that the
7 * exception is caught by the right try block, and all finally blocks
10 * Author: christine@netscape.com
11 * Date: 11 August 1998
13 var SECTION
= "try-010";
14 var VERSION
= "ECMA_2";
15 var TITLE
= "The try statement: try in a tryblock";
18 writeHeaderToLog( SECTION
+ " "+ TITLE
);
21 var testcases
= new Array();
23 var EXCEPTION_STRING
= "Exception thrown: ";
24 var NO_EXCEPTION_STRING
= "No exception thrown: ";
27 NestedTry( new TryObject( "No Exceptions Thrown", NoException
, NoException
, 43 ) );
28 NestedTry( new TryObject( "Throw Exception in Outer Try", ThrowException
, NoException
, 48 ));
29 NestedTry( new TryObject( "Throw Exception in Inner Try", NoException
, ThrowException
, 45 ));
30 NestedTry( new TryObject( "Throw Exception in Both Trys", ThrowException
, ThrowException
, 48 ));
34 function TryObject( description
, tryOne
, tryTwo
, result
) {
35 this.description
= description
;
40 function ThrowException() {
41 throw EXCEPTION_STRING
+ this.value
;
43 function NoException() {
44 return NO_EXCEPTION_STRING
+ this.value
;
46 function NestedTry( object
) {
65 testcases
[tc
++] = new TestCase(