1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
5 esid: sec-array.prototype.concat
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
11 description: Checking this algorithm, items are Array object
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');