summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/bug1684821.js
blob: dfbefd9962708b2eca8e2bfbf61f23f6c83e3808 (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
let g = newGlobal({newCompartment: true});
let d = new Debugger(g);

d.onDebuggerStatement = function (frame) {
  frame.environment;
};

g.evaluate(`
  function * foo() {
    // Force CallObject + LexicalEnvironmentObject
    let x;
    let y = () => x;

    // Force DebuggerEnvironment
    debugger;

    // Force suspend and frame snapshot
    yield;

    // Popping this frame will trigger a second snapshot
  }
`)

let x = g.foo();
x.next();
x.next();