blob: 4c4a65b5e964f59ac92d4bd3c8fe1f0ff04d1226 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
// Debugger.Frame.prototype.type on an async generator.
load(libdir + "asserts.js");
const g = newGlobal({ newCompartment: true });
const dbg = Debugger(g);
g.eval(`
async function* f() {
await Promise.resolve();
}
`);
let frame;
dbg.onEnterFrame = function(f) {
frame = f;
assertEq(frame.type, "call");
};
(async () => {
const it = g.f();
assertEq(frame.type, "call");
frame = null;
const promise = it.next();
assertEq(!!frame, true);
assertEq(frame.type, "call");
await promise;
// Throws because the frame has terminated.
assertThrowsInstanceOf(() => frame.type, Error);
})();
|