1 load(libdir + "array-compare.js");
10 // Few arguments. Even number of arguments.
13 // Few arguments. Odd number of arguments.
16 // Many arguments. Even number of arguments.
17 [1, 2, 3, 4, 5, 6, 7, 8, 9, 0],
19 // Many arguments. Odd number of arguments.
20 [1, 2, 3, 4, 5, 6, 7, 8, 9],
24 // SpreadNew to a native function with rest-args.
25 return new Array(...x);
28 // Don't inline |f| into the top-level script.
31 for (let i = 0; i < 400; ++i) {
32 let x = xs[i % xs.length];
34 // NB: Array(1) creates the array `[,]`.
35 let expected = x.length !== 1 ? x : [,];
37 let result = f.apply(null, x);
38 assertEq(arraysEqual(result, expected), true);