S15.4.2.2_A2.3_T2.js (862B)
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 esid: sec-array-len 6 info: | 7 If the argument len is not a Number, then the length property of 8 the newly constructed object is set to 1 and the 0 property of 9 the newly constructed object is set to len 10 es5id: 15.4.2.2_A2.3_T2 11 description: Checking for boolean primitive and Boolean object 12 ---*/ 13 14 var x = new Array(true); 15 16 assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); 17 assert.sameValue(x[0], true, 'The value of x[0] is expected to be true'); 18 19 var obj = new Boolean(false); 20 var x = new Array(obj); 21 22 assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); 23 assert.sameValue(x[0], obj, 'The value of x[0] is expected to equal the value of obj'); 24 25 reportCompare(0, 0);