S15.6.2.1_A2.js (951B)
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 The [[Prototype]] property of the newly constructed object 7 is set to the original Boolean prototype object, the one that is the 8 initial value of Boolean.prototype 9 esid: sec-boolean-constructor 10 description: Checking prototype property of the newly created object 11 ---*/ 12 13 // CHECK#1 14 var x1 = new Boolean(1); 15 16 assert.sameValue( 17 typeof x1.constructor.prototype, 18 "object", 19 'The value of `typeof x1.constructor.prototype` is expected to be "object"' 20 ); 21 22 var x2 = new Boolean(2); 23 assert(Boolean.prototype.isPrototypeOf(x2), 'Boolean.prototype.isPrototypeOf(x2) must return true'); 24 25 var x3 = new Boolean(3); 26 27 assert.sameValue( 28 Boolean.prototype, 29 x3.constructor.prototype, 30 'The value of Boolean.prototype is expected to equal the value of x3.constructor.prototype' 31 ); 32 33 reportCompare(0, 0);