]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma_2/Exceptions/exception-006.js
2 * File Name: exception-006
4 * Description: Tests for JavaScript Standard Exceptions
8 * Author: christine@netscape.com
11 var SECTION
= "exception-006";
12 var VERSION
= "js1_4";
13 var TITLE
= "Tests for JavaScript Standard Exceptions: TypeError";
16 writeHeaderToLog( SECTION
+ " "+ TITLE
);
19 var testcases
= new Array();
27 * Getting the [[DefaultValue]] of any instances of MyObject
28 * should result in a runtime error in ToPrimitive.
32 this.toString
= void 0;
33 this.valueOf
= void 0;
36 function ToPrimitive_1() {
37 result
= "failed: no exception thrown";
41 result
= new MyObject() + new MyObject();
43 result
= "passed: threw exception",
44 exception
= e
.toString();
46 testcases
[tc
++] = new TestCase(
48 "new MyObject() + new MyObject() [ exception is " + exception
+" ]",
49 "passed: threw exception",