S11.1.4_A1.2.js (983B)
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: "Evaluate the production ArrayLiteral: [ Elision ]" 6 es5id: 11.1.4_A1.2 7 description: > 8 Checking various properties the array defined with "var array = 9 [,,,,,]" 10 ---*/ 11 12 var array = [,,,,,]; 13 14 //CHECK#1 15 if (typeof array !== "object") { 16 throw new Test262Error('#1: var array = [,,,,,]; typeof array === "object". Actual: ' + (typeof array)); 17 } 18 19 //CHECK#2 20 if (array instanceof Array !== true) { 21 throw new Test262Error('#2: var array = [,,,,,]; array instanceof Array === true'); 22 } 23 24 //CHECK#3 25 if (array.toString !== Array.prototype.toString) { 26 throw new Test262Error('#3: var array = [,,,,,]; array.toString === Array.prototype.toString. Actual: ' + (array.toString)); 27 } 28 29 //CHECK#4 30 if (array.length !== 5) { 31 throw new Test262Error('#4: var array = [,,,,,]; array.length === 5. Actual: ' + (array.length)); 32 } 33 34 reportCompare(0, 0);