summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-terminated-03.js
blob: c5ca4febda194d55b724636090057bc19872145a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Check `.terminated` functionality for generator functions.

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

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

let frame;
dbg.onEnterFrame = function(f) {
  frame = f;
  assertEq(frame.terminated, false);
};

const it = g.f();

assertEq(frame instanceof Debugger.Frame, true);
assertEq(frame.terminated, false);

it.next();

assertEq(frame.terminated, true);