summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/warp/bug1761947.js
blob: 64d640617255f1260eae585f77eb676eb26938cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
let trigger = false;

function bar(x) {
  with ({}) {}
  if (trigger) {
    gc(foo, "shrinking");
    trigger = false;
  }
  return Object(x);
}

function foo() {
  let result = undefined;
  const arr = [8];
  for (var i = 0; i < 10; i++) {
    result = bar(...arr);
    assertEq(Number(result), 8);
  }
  return result;
}

with ({}) {}
for (var i = 0; i < 100; i++) {
  foo();
}

trigger = true;
foo();