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