Bug 1102549 - Make Debugger::slowPathPromiseHook handle various JSTrapStatus results. r=shu

This commit is contained in:
Nick Fitzgerald 2014-12-09 11:59:25 -08:00
parent 54188fb057
commit 648a7399a9
2 changed files with 9 additions and 3 deletions

View File

@ -0,0 +1,5 @@
// |jit-test| error: log is not defined
var g = newGlobal();
var dbg = new Debugger(g);
dbg.onPromiseSettled = function (g) { log += 's'; throw "foopy"; };
g.settleFakePromise(g.makeFakePromise());

View File

@ -1683,9 +1683,10 @@ Debugger::slowPathPromiseHook(JSContext *cx, Hook hook, HandleObject promise)
{
MOZ_ASSERT(hook == OnNewPromise || hook == OnPromiseSettled);
RootedValue rval(cx);
DebugOnly<JSTrapStatus> status = dispatchHook(cx, &rval, hook, promise);
MOZ_ASSERT(status == JSTRAP_CONTINUE);
MOZ_ASSERT(!cx->isExceptionPending());
// Promise hooks are infallible and we ignore errors from uncaught
// exceptions by design.
(void) dispatchHook(cx, &rval, hook, promise);
}