Debian Codegraph @

js/src/jit-test/tests/debug/onEnterFrame-async-resumption-13.js

raw
1 // An onPop handler can return its input argument for async generators. The
2 // debugger correctly adjusts the state of the async generator object.
3
4 let g = newGlobal({newCompartment: true});
5 g.eval(`
6 async function* f() {}
7 `);
8
9 let hits = 0;
10 let dbg = new Debugger(g);
11 dbg.onEnterFrame = frame => {
12 frame.onPop = completion => {
13 hits++;
14 return completion;
15 };
16 };
17
18 let it = g.f();
19 let p = it.next();
20
21 assertEq(hits, 1);