From 1437d0fe3804f544ffb53d96f41092dd6e009631 Mon Sep 17 00:00:00 2001 From: Hiroki Nakagawa Date: Wed, 2 Oct 2019 11:03:38 +0900 Subject: [PATCH] [worklets] Queue a task to reject addModule() This is a follow-up patch for #958. A task to reject addModule() should be queued with script's error to rethrow to run on the thread where addModule() is called. --- worklets/Overview.bs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/worklets/Overview.bs b/worklets/Overview.bs index af3967c6..d33c2df3 100644 --- a/worklets/Overview.bs +++ b/worklets/Overview.bs @@ -449,14 +449,16 @@ When the user agent is to fetch and invoke a worklet script given |wo 2. Reject |promise| with an "{{AbortError}}" {{DOMException}}. - 4. If |script|'s error to rethrow is not null, then run these steps: + 4. If |script|'s error to rethrow is not null, then queue a task on + |outsideSettings|'s responsible event loop given |script|'s error to rethrow + to run these steps: 1. If |pendingTaskStruct|'s counter is not -1, then run these steps: 1. Set |pendingTaskStruct|'s counter to -1. - 2. Reject |promise| with |script|'s error to rethrow. + 2. Reject |promise| with error to rethrow. 5. Run a module script given |script|.