summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/spread-array-evaluation-order.js
blob: 0887a059261e7314b2ace6320313356f4ddfc312 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
load(libdir + "eqArrayHelper.js");

var check = [];
function t(token) {
    check.push(token);
    return token;
}
[3, ...[t(1)],, ...[t(2), t(3)], 34, 42, ...[t(4)]];
assertEqArray(check, [1, 2, 3, 4]);

var arr = [1, 2, 3];
assertEqArray([...arr, arr.pop()], [1, 2, 3, 3]);