initial import
[vuplus_webkit] / Source / JavaScriptCore / tests / mozilla / ecma_2 / Exceptions / exception-001.js
1 /**
2  *  File Name:          exception-001
3  *  ECMA Section:
4  *  Description:        Tests for JavaScript Standard Exceptions
5  *
6  *  Call error.
7  *
8  *  Author:             christine@netscape.com
9  *  Date:               31 August 1998
10  */
11     var SECTION = "exception-001";
12     var VERSION = "js1_4";
13     var TITLE   = "Tests for JavaScript Standard Exceptions:  CallError";
14
15     startTest();
16     writeHeaderToLog( SECTION + " "+ TITLE);
17
18     var tc = 0;
19     var testcases = new Array();
20
21     Call_1();
22
23     test();
24
25     function Call_1() {
26         result = "failed: no exception thrown";
27         exception = null;
28
29         try {
30             Math();
31         } catch ( e ) {
32             result = "passed:  threw exception",
33             exception = e.toString();
34         } finally {
35             testcases[tc++] = new TestCase(
36                 SECTION,
37                 "Math() [ exception is " + exception +" ]",
38                 "passed:  threw exception",
39                 result );
40         }
41     }
42