summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/onEnterFrame-generator-10.js
blob: 32546dc4d18c4b12db6af651297dc7f2aa7661e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Bug 1556033. Test behavior of onEnterFrame "return" completion
// values during explicit .next() calls.

let g = newGlobal({newCompartment: true});
g.eval(`function* f(x) { }`);
let dbg = new Debugger(g);

let it = g.f();

dbg.onEnterFrame = () => ({ return: "exit" });
const result = it.next();
assertEq(result.value, "exit");
assertEq(result.done, true);

const result2 = it.next();
assertEq(result2.value, undefined);
assertEq(result2.done, true);