Debian Codegraph @

js/src/tests/test262/language/expressions/array/S11.1.4_A1.1.js

raw
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: [ ]"
6 es5id: 11.1.4_A1.1
7 description: >
8 Checking various properties of the array defined with expression
9 "var array = []"
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 !== 0) {
31 throw new Test262Error('#4: var array = []; array.length === 0. Actual: ' + (array.length));
32 }
33
34 reportCompare(0, 0);