summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/auto-regress/bug1791401.js
blob: 6b3a7a5dbd70647391972800e39b1d8b7abf5ce0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// |jit-test| skip-if: !('oomTest' in this)

oomTest(function() {
  var f = Function(`
    // Don't actually enter the loop. This still causes the original bug and
    // additionally makes the test complete faster.
    //
    // Don't directly use |false|, otherwise the byte code emitter won't emit
    // the loop.
    var False = [false, false][0];
    if (False) {
      for (let x;;) {
        // Capture |x|, so it's freshened each loop iteration.
        Object(() => x);
      }
     }
  `);
  f();
});