Debian Codegraph @

js/src/jit-test/tests/debug/throw-exception-stack-location-async.js

raw
1 ignoreUnhandledRejections();
2
3 let g = newGlobal({newCompartment: true});
4 let dbg = new Debugger();
5 let gw = dbg.addDebuggee(g);
6
7 g.eval(`
8 function throwValue(value) {
9 throw value;
10 }
11
12 async function f() {
13 throwValue("exception-value");
14 }
15
16 this.promise = f();
17 `);
18
19 let promise = gw.makeDebuggeeValue(g.f());
20
21 assertEq(promise.isPromise, true);
22 assertEq(promise.promiseState, "rejected");
23 if (promise.promiseResolutionSite !== null) {
24 assertEq(promise.promiseResolutionSite.toString().includes("throwValue"), true);
25 }