summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-onStack-06.js
blob: 8316da9b9e6792d5da19a55235ebc9581296972f (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
// frame.onStack is false for generator frames after they return.

let g = newGlobal({newCompartment: true});
g.eval("function* f() { debugger; }");

let dbg = Debugger(g);
let savedFrame;

dbg.onDebuggerStatement = frame => {
    savedFrame = frame;
    assertEq(frame.callee.name, "f");
    assertEq(frame.onStack, true);
    frame.onPop = function() {
        assertEq(frame.onStack, true);
    };
};
g.f().next();

assertEq(savedFrame.onStack, false);
try {
    savedFrame.older;
    throw new Error("expected exception, none thrown");
} catch (exc) {
    assertEq(exc.message, "Debugger.Frame is not on stack or suspended");
}