summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-onNewPromise-07.js
blob: 4ef41cc67c30c6e77bbc2e36df121047ca8ee059 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Errors in onNewPromise handlers are reported correctly, and don't mess up the
// promise creation.

var g = newGlobal({newCompartment: true});
var dbg = new Debugger(g);

let e;
dbg.uncaughtExceptionHook = ee => { e = ee; };
dbg.onNewPromise = () => { throw new Error("woops!"); };

assertEq(typeof new g.Promise(function (){}), "object");
assertEq(!!e, true);
assertEq(!!e.message.match(/woops/), true);