]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma_2/Exceptions/boolean-001.js
2 File Name: boolean-001.js
3 Description: Corresponds to ecma/Boolean/15.6.4.2-4-n.js
5 The toString function is not generic; it generates
6 a runtime error if its this value is not a Boolean
7 object. Therefore it cannot be transferred to other
8 kinds of objects for use as a method.
10 Author: christine@netscape.com
13 var SECTION
= "boolean-001.js";
14 var VERSION
= "JS1_4";
15 var TITLE
= "Boolean.prototype.toString()";
17 writeHeaderToLog( SECTION
+" "+ TITLE
);
20 var testcases
= new Array();
22 var exception
= "No exception thrown";
23 var result
= "Failed";
25 var TO_STRING
= Boolean
.prototype.toString
;
28 var s
= new String("Not a Boolean");
29 s
.toString
= TO_STRING
;
33 exception
= e
.toString();
36 testcases
[tc
++] = new TestCase(
38 "Assigning Boolean.prototype.toString to a String object "+
39 "(threw " +exception
+")",