summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/bug-1584195.js
blob: 93aca7291d13f2c3bef6882971b2acfcb736d95c (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
29
30
31
// |jit-test| skip-if: !('gczeal' in this)
// Bug 1584195: Debugger.Frame finalizer should't try to apply
// IsAboutToBeFinalized to cells of other alloc kinds, whose arenas may have
// been turned over to fresh allocations.

try {
  evaluate(`
    var g9 = newGlobal({newCompartment: true});
    g9.parent = this;
    g9.eval(\`
      var dbg = new Debugger(parent);
      dbg.onEnterFrame = frame => {};
    \`);
    function lfPromise(x) {
        return new Promise(resolve => {});
    }
    async function lfAsync() {
        await lfPromise();
    } lfAsync();
  `);
  gczeal(20, 2);
  evaluate(`
    async function lfAsync() {} lfAsync();
  `);
  gczeal(12, 7);
  drainJobQueue();
  evaluate(`
    new { ...  v22 => { 
  `);
} catch (exc) {}
evaluate("");