summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/throw-exception-stack-location-async.js
blob: ece117cb0b6b939772987256123051fabaca5792 (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
ignoreUnhandledRejections();

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

g.eval(`
function throwValue(value) {
  throw value;
}

async function f() {
  throwValue("exception-value");
}

this.promise = f();
`);

let promise = gw.makeDebuggeeValue(g.f());

assertEq(promise.isPromise, true);
assertEq(promise.promiseState, "rejected");
if (promise.promiseResolutionSite !== null) {
  assertEq(promise.promiseResolutionSite.toString().includes("throwValue"), true);
}