Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / Array / prototype / concat / S15.4.4.4_A2_T1.js
blob8cf2de37a266f391e3fcb3ed9aadfd39066bb758
1 // Copyright 2009 the Sputnik authors.  All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 esid: sec-array.prototype.concat
6 info: |
7     The concat function is intentionally generic.
8     It does not require that its this value be an Array object
9 es5id: 15.4.4.4_A2_T1
10 description: Checking this for Object object, items are objects and primitives
11 ---*/
13 var x = {};
14 x.concat = Array.prototype.concat;
15 var y = new Object();
16 var z = new Array(1, 2);
17 var arr = x.concat(y, z, -1, true, "NaN");
19 arr.getClass = Object.prototype.toString;
20 assert.sameValue(arr.getClass(), "[object Array]", 'arr.getClass() must return "[object Array]"');
21 assert.sameValue(arr[0], x, 'The value of arr[0] is expected to equal the value of x');
22 assert.sameValue(arr[1], y, 'The value of arr[1] is expected to equal the value of y');
23 assert.sameValue(arr[2], 1, 'The value of arr[2] is expected to be 1');
24 assert.sameValue(arr[3], 2, 'The value of arr[3] is expected to be 2');
25 assert.sameValue(arr[4], -1, 'The value of arr[4] is expected to be -1');
26 assert.sameValue(arr[5], true, 'The value of arr[5] is expected to be true');
27 assert.sameValue(arr[6], "NaN", 'The value of arr[6] is expected to be "NaN"');
28 assert.sameValue(arr.length, 7, 'The value of arr.length is expected to be 7');
30 reportCompare(0, 0);