S15.4.2.2_A2.3_T1.js (819B)
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_T1 11 description: Checking for null and undefined 12 ---*/ 13 14 var x = new Array(null); 15 16 assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); 17 assert.sameValue(x[0], null, 'The value of x[0] is expected to be null'); 18 19 var x = new Array(undefined); 20 21 assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); 22 assert.sameValue(x[0], undefined, 'The value of x[0] is expected to equal undefined'); 23 24 reportCompare(0, 0);