зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1545354: Don't try to reject an already resolved async function promise on OOM. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D28476 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
cf3c088f59
Коммит
1b38a811a1
|
@ -116,15 +116,16 @@ static bool AsyncFunctionResume(JSContext* cx,
|
|||
&generatorOrValue)) {
|
||||
if (!generator->isClosed()) {
|
||||
generator->setClosed();
|
||||
}
|
||||
|
||||
// Handle the OOM case mentioned above.
|
||||
if (cx->isExceptionPending()) {
|
||||
RootedValue exn(cx);
|
||||
if (!GetAndClearException(cx, &exn)) {
|
||||
return false;
|
||||
}
|
||||
return AsyncFunctionThrown(cx, resultPromise, exn);
|
||||
// Handle the OOM case mentioned above.
|
||||
if (resultPromise->state() == JS::PromiseState::Pending &&
|
||||
cx->isExceptionPending()) {
|
||||
RootedValue exn(cx);
|
||||
if (!GetAndClearException(cx, &exn)) {
|
||||
return false;
|
||||
}
|
||||
return AsyncFunctionThrown(cx, resultPromise, exn);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче