From d542252cd7cfb9b88014b994b84e98d72c0245e8 Mon Sep 17 00:00:00 2001 From: autokagami Date: Mon, 30 Sep 2019 19:11:53 +0900 Subject: [PATCH 1/2] [worklets-1] Align with Web IDL specification --- worklets/Overview.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worklets/Overview.bs b/worklets/Overview.bs index a919a0fa..b1bf12d8 100644 --- a/worklets/Overview.bs +++ b/worklets/Overview.bs @@ -336,7 +336,7 @@ The {{Worklet}} object provides the capability to add module scripts into its as
 [Exposed=Window]
 interface Worklet {
-    [NewObject] Promise<void> addModule(USVString moduleURL, optional WorkletOptions options);
+    [NewObject] Promise<void> addModule(USVString moduleURL, optional WorkletOptions options = {});
 };
 
 dictionary WorkletOptions {

From f318370aa75f240d542d0044dbab89e3533e77d5 Mon Sep 17 00:00:00 2001
From: autokagami 
Date: Fri, 22 Nov 2019 14:28:12 +0900
Subject: [PATCH 2/2] [worklets-1] Align with Web IDL specification

---
 worklets/Overview.bs | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/worklets/Overview.bs b/worklets/Overview.bs
index b1bf12d8..ca343c24 100644
--- a/worklets/Overview.bs
+++ b/worklets/Overview.bs
@@ -449,9 +449,20 @@ When the user agent is to fetch and invoke a worklet script given |wo
 
             2. Reject |promise| with an "{{AbortError}}" {{DOMException}}.
 
-    4. Run a module script given |script|.
+    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:
 
-    5. Queue a task on |outsideSettings|'s responsible event loop 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 error to rethrow.
+
+    5. Run a module script given |script|.
+
+    6. Queue a task on |outsideSettings|'s responsible event loop to run these steps:
 
         1. If |pendingTaskStruct|'s counter is not -1, then
             run these steps: