summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-older-generators-03.js
blob: 128898b206ebce9133dadc97cf76c1b8ca1cac7e (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
// Test that Debugger.Frame.prototype.older works on suspended generators.

load(libdir + "asserts.js");

const g = newGlobal({ newCompartment: true });
const dbg = new Debugger(g);

g.eval(`
function* f() {}
`);

let frame;
dbg.onEnterFrame = f => {
  frame = f;
  dbg.onEnterFrame = undefined;
};

const it = g.f();

assertEq(frame.older, null);

it.next();

assertThrowsInstanceOf(() => frame.older, Error);