зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
91acfa8f3f
Коммит
ff71e7aae1
|
@ -2269,9 +2269,13 @@ void js::AsyncModuleExecutionFulfilled(JSContext* cx,
|
|||
|
||||
RootedArrayObject sortedList(cx);
|
||||
if (!ModuleObject::GatherAsyncParentCompletions(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;
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
// |jit-test| exitstatus: 6;
|
||||
|
||||
b = parseModule("await 10");
|
||||
b.declarationInstantiation();
|
||||
b.evaluation();
|
||||
setInterruptCallback(function() {
|
||||
c();
|
||||
});
|
||||
function c() {
|
||||
interruptIf(true);
|
||||
}
|
||||
c();
|
Загрузка…
Ссылка в новой задаче