S15.7.2.1_A1.js (1295B)
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 When Number is called as part of a new expression it is 7 a constructor: it initialises the newly created object 8 es5id: 15.7.2.1_A1 9 description: Checking type of the newly created object and it value 10 ---*/ 11 assert.sameValue(typeof new Number(), "object", 'The value of `typeof new Number()` is expected to be "object"'); 12 assert.notSameValue(new Number(), undefined, 'new Number() is expected to not equal ``undefined``'); 13 14 var x3 = new Number(); 15 assert.sameValue(typeof x3, "object", 'The value of `typeof x3` is expected to be "object"'); 16 17 var x4 = new Number(); 18 assert.notSameValue(x4, undefined, 'The value of x4 is expected to not equal ``undefined``'); 19 assert.sameValue(typeof new Number(10), "object", 'The value of `typeof new Number(10)` is expected to be "object"'); 20 assert.notSameValue(new Number(10), undefined, 'new Number(10) is expected to not equal ``undefined``'); 21 22 var x7 = new Number(10); 23 assert.sameValue(typeof x7, "object", 'The value of `typeof x7` is expected to be "object"'); 24 25 var x8 = new Number(10); 26 assert.notSameValue(x8, undefined, 'The value of x8 is expected to not equal ``undefined``'); 27 28 reportCompare(0, 0);