| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = 'exception-002.js'; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
var SECTION = "exception-002"; |
| 19 |
var VERSION = "js1_4"; |
| 20 |
var TITLE = "Tests for JavaScript Standard Exceptions: ConstructError"; |
| 21 |
|
| 22 |
startTest(); |
| 23 |
writeHeaderToLog( SECTION + " "+ TITLE); |
| 24 |
|
| 25 |
Construct_1(); |
| 26 |
|
| 27 |
test(); |
| 28 |
|
| 29 |
function Construct_1() { |
| 30 |
result = "failed: no exception thrown"; |
| 31 |
exception = null; |
| 32 |
|
| 33 |
try { |
| 34 |
result = new Math(); |
| 35 |
} catch ( e ) { |
| 36 |
result = "passed: threw exception", |
| 37 |
exception = e.toString(); |
| 38 |
} finally { |
| 39 |
new TestCase( |
| 40 |
SECTION, |
| 41 |
"new Math() [ exception is " + exception +" ]", |
| 42 |
"passed: threw exception", |
| 43 |
result ); |
| 44 |
} |
| 45 |
} |
| 46 |
|