S9.9_A3.js (1162B)
1 // Copyright 2009 the Sputnik authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 info: | 6 ToObject conversion from Boolean: create a new Boolean object 7 whose [[value]] property is set to the value of the boolean 8 es5id: 9.9_A3 9 description: Trying to convert from Boolean to Object 10 ---*/ 11 assert.sameValue(Object(true).valueOf(), true, 'Object(true).valueOf() must return true'); 12 assert.sameValue(typeof Object(true), "object", 'The value of `typeof Object(true)` is expected to be "object"'); 13 14 assert.sameValue( 15 Object(true).constructor.prototype, 16 Boolean.prototype, 17 'The value of Object(true).constructor.prototype is expected to equal the value of Boolean.prototype' 18 ); 19 20 assert.sameValue(Object(false).valueOf(), false, 'Object(false).valueOf() must return false'); 21 assert.sameValue(typeof Object(false), "object", 'The value of `typeof Object(false)` is expected to be "object"'); 22 23 assert.sameValue( 24 Object(false).constructor.prototype, 25 Boolean.prototype, 26 'The value of Object(false).constructor.prototype is expected to equal the value of Boolean.prototype' 27 ); 28 29 reportCompare(0, 0);