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_A1_T1.js
blob7d4bd82f39535da39ade41bf09fd0ade959844ae
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     When the concat method is called with zero or more arguments item1, item2,
8     etc., it returns an array containing the array elements of the object followed by
9     the array elements of each argument in order
10 es5id: 15.4.4.4_A1_T1
11 description: Checking this algorithm, items are Array object
12 ---*/
14 var x = new Array();
15 var y = new Array(0, 1);
16 var z = new Array(2, 3, 4);
17 var arr = x.concat(y, z);
19 arr.getClass = Object.prototype.toString;
20 assert.sameValue(arr.getClass(), "[object Array]", 'arr.getClass() must return "[object Array]"');
21 assert.sameValue(arr[0], 0, 'The value of arr[0] is expected to be 0');
22 assert.sameValue(arr[1], 1, 'The value of arr[1] is expected to be 1');
23 assert.sameValue(arr[2], 2, 'The value of arr[2] is expected to be 2');
24 assert.sameValue(arr[3], 3, 'The value of arr[3] is expected to be 3');
25 assert.sameValue(arr[4], 4, 'The value of arr[4] is expected to be 4');
26 assert.sameValue(arr.length, 5, 'The value of arr.length is expected to be 5');
28 reportCompare(0, 0);