Bug 1771858 - Handle interrupt in AsyncModuleExecutionFulfilled; r=jonco

In AsyncModuleExecutionFulfilled, it's possible that the call to GatherAsyncParentCompletions
will fail if we are interrupted. The current code assumes that this is only reachable as a
result of an OOM. This changes the assertion to an if statement to handle being interrupted.

Differential Revision: https://phabricator.services.mozilla.com/D147954
This commit is contained in:
Dan Minor 2022-07-05 23:33:54 +00:00
Родитель 1eb734ef35
Коммит fff73b0151
1 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -2311,9 +2311,13 @@ void js::AsyncModuleExecutionFulfilled(JSContext* cx,
Rooted<ModuleVector> sortedList(cx);
if (!GatherAvailableModuleAncestors(cx, module, &sortedList)) {
// We have OOM'd -- all bets are off, reject the promise. Not much more we
// can do.
MOZ_ASSERT(cx->isExceptionPending());
// We have been interrupted or have OOM'd -- all bets are off, reject the
// promise. Not much more we can do.
if (!cx->isExceptionPending()) {
AsyncModuleExecutionRejected(cx, module, UndefinedHandleValue);
return;
}
RootedValue exception(cx);
if (!cx->getPendingException(&exception)) {
return;