summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/onEnterFrame-generator-08.js
blob: 493b718155be1533fb72f073f4bb762eb4baf856 (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 .throw() 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.throw();
assertEq(result.value, "exit");
assertEq(result.done, true);

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