summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/spread-call-funcall.js
blob: 97edfb6599bb13007aaf048d76de6131ce9f18df (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) { return x; });
check((...x) => x);