summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/spread-call-funcall.js
blob: bcb3c0024f1fd9a73178da57be42b80398cf0672 (plain)
1
2
3
4
5
6
7
8
9
10
11
load(libdir + "eqArrayHelper.js");

function check(f) {
  assertEqArray(f.call(...[null], 1, 2, 3), [1, 2, 3]);
  assertEqArray(f.call(...[null], 1, ...[2, 3], 4, ...[5, 6]), [1, 2, 3, 4, 5, 6]);
  assertEqArray(f.call(...[null, 1], ...[2, 3], 4, ...[5, 6]), [1, 2, 3, 4, 5, 6]);
  assertEqArray(f.call(...[null, 1, ...[2, 3], 4, ...[5, 6]]), [1, 2, 3, 4, 5, 6]);
}

check(function(...x) x);
check((...x) => x);