summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/onEnterFrame-async-resumption-10.js
blob: 3dfeb112c2117ada191980b2b23866c589813e6d (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
// Resolve async function promise when initially awaiting.

let g = newGlobal({newCompartment: true});
let dbg = new Debugger();
let gw = dbg.addDebuggee(g);

g.eval(`
    var resolve;
    var p = new Promise(r => {
        resolve = r;
    });

    async function f() {
        await p;
    }
`);

dbg.onEnterFrame = frame => {
    frame.onPop = completion => {
        g.resolve(0);
        drainJobQueue();
    };
};
g.f();