summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/arguments/recover-spread-opt-arguments-after-bail.js
blob: c8c76c278a2d83a81935933eb27a9a6b7370fcac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function outer(fn, x, y) {
  fn(...arguments);
}

function inner1(fn, x, y) {
  assertEq(fn, inner1);
  assertEq(x, y);
}

function inner2(fn, x, y) {
  assertEq(fn, inner2);
  assertEq(x, 100);
  assertEq(y, 200);
}

for (let i = 0; i < 100; i++) {
  outer(inner1, i, i);
}

// Call with a different function to cause a bailout. This will lead to
// recovering the |arguments| object.
outer(inner2, 100, 200);