Debian Codegraph @

js/src/jit-test/tests/debug/onEnterFrame-generator-resumption-05.js

raw
1 // {return:} from the initial onEnterFrame for a generator is an error.
2
3 load(libdir + "asserts.js");
4
5 let g = newGlobal({newCompartment: true});
6 g.values = [1, 2, 3];
7 g.eval(`function* f(arr=values) { yield* arr; }`);
8
9 let dbg = Debugger(g);
10
11 let hits = 0;
12 dbg.onEnterFrame = frame => {
13 assertEq(frame.callee.name, "f");
14 hits++;
15 return {return: 123};
16 };
17 dbg.uncaughtExceptionHook = exc => {
18 assertEq(exc instanceof TypeError, true);
19 return {throw: "REJECTED"};
20 }
21 assertThrowsValue(g.f, "REJECTED");
22 assertEq(hits, 1);