| * Description: The try statement |
| * This test has a try with one catch block but no finally. |
| * Author: christine@netscape.com |
| var TITLE = "The try statement"; |
| writeHeaderToLog( SECTION + " "+ TITLE); |
| var testcases = new Array(); |
| TryToCatch( "Math.PI", Math.PI ); |
| TryToCatch( "Thrower(5)", "Caught 5" ); |
| TryToCatch( "Thrower(\"some random exception\")", "Caught some random exception" ); |
| * Evaluate a string. Catch any exceptions thrown. If no exception is |
| * expected, verify the result of the evaluation. If an exception is |
| * expected, verify that we got the right exception. |
| function TryToCatch( value, expect ) { |
| testcases[tc++] = new TestCase( |