Issue #1691 - Part 4: Finish implementing call import. https://bugzilla.mozilla.org/show_bug.cgi?id=1499140

(cherry picked from commit 7bf7d64887944b127a72090dd62eb57f67c5089d)
This commit is contained in:
Brian Smith 2023-04-09 03:06:39 -05:00 committed by roytam1
commit 7a6dab0b38
35 changed files with 533 additions and 24 deletions

View file

@ -3863,6 +3863,16 @@ OriginalPromiseThenBuiltin(JSContext* cx, HandleValue promiseVal, HandleValue on
return true;
}
MOZ_MUST_USE bool
js::RejectPromiseWithPendingError(JSContext* cx, Handle<PromiseObject*> promise)
{
// Not much we can do about uncatchable exceptions, just bail.
RootedValue exn(cx);
if (!GetAndClearException(cx, &exn))
return false;
return PromiseObject::reject(cx, promise, exn);
}
static MOZ_MUST_USE bool PerformPromiseThenWithReaction(JSContext* cx,
Handle<PromiseObject*> promise,
Handle<PromiseReactionRecord*> reaction);