S15.7.2.1_A2.js (932B)
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 Number prototype object, the one that is the 8 initial value of Number.prototype 9 es5id: 15.7.2.1_A2 10 description: Checking prototype property of the newly created objects 11 ---*/ 12 13 // CHECK#1 14 var x1 = new Number(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 Number(2); 23 assert(Number.prototype.isPrototypeOf(x2), 'Number.prototype.isPrototypeOf(x2) must return true'); 24 25 var x3 = new Number(3); 26 27 assert.sameValue( 28 Number.prototype, 29 x3.constructor.prototype, 30 'The value of Number.prototype is expected to equal the value of x3.constructor.prototype' 31 ); 32 33 reportCompare(0, 0);