summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-onPop-generators-08.js
blob: 75238ee17c1a005f5231a937f33ebc5f87d7ae49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Creating a new generator frame after the generator is closed.

var g = newGlobal({ newCompartment: true });
g.eval("function* gen(x) { debugger; }");
var dbg = new Debugger(g);
dbg.onDebuggerStatement = frame => {
  frame.onPop = completion => {
    assertEq(frame.callee.name, "gen");
    assertEq(frame.eval("x").return, 3);
    var f2 = (new Debugger(g)).getNewestFrame();
    assertEq(f2.callee.name, "gen");
    assertEq(f2.eval("x").return, 3);
  };
};
g.gen(3).next();