michael@0: // Copyright 2009 the Sputnik authors. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * ToObject conversion from Boolean: create a new Boolean object michael@0: * whose [[value]] property is set to the value of the boolean michael@0: * michael@0: * @path ch09/9.9/S9.9_A3.js michael@0: * @description Trying to convert from Boolean to Object michael@0: */ michael@0: michael@0: // CHECK#1 michael@0: if (Object(true).valueOf() !== true){ michael@0: $ERROR('#1: Object(true).valueOf() === true. Actual: ' + (Object(true).valueOf())); michael@0: } michael@0: michael@0: // CHECK#2 michael@0: if (typeof Object(true) !== "object"){ michael@0: $ERROR('#2: typeof Object(true) === "object". Actual: ' + (typeof Object(true))); michael@0: } michael@0: michael@0: // CHECK#3 michael@0: if (Object(true).constructor.prototype !== Boolean.prototype){ michael@0: $ERROR('#3: Object(true).constructor.prototype === Boolean.prototype. Actual: ' + (Object(true).constructor.prototype)); michael@0: } michael@0: michael@0: // CHECK#4 michael@0: if (Object(false).valueOf() !== false){ michael@0: $ERROR('#4: Object(false).valueOf() === false. Actual: ' + (Object(false).valueOf())); michael@0: } michael@0: michael@0: // CHECK#5 michael@0: if (typeof Object(false) !== "object"){ michael@0: $ERROR('#5: typeof Object(false) === "object". Actual: ' + (typeof Object(false))); michael@0: } michael@0: michael@0: // CHECK#6 michael@0: if (Object(false).constructor.prototype !== Boolean.prototype){ michael@0: $ERROR('#6: Object(false).constructor.prototype === Boolean.prototype. Actual: ' + (Object(false).constructor.prototype)); michael@0: } michael@0: