@@ -11,10 +11,12 @@ Editor: Ian Kilpatrick, ikilpatrick@chromium.org
11
11
</pre>
12
12
13
13
<pre class="anchors">
14
- urlPrefix: http://heycam.github.io/webidl/#dfn-; type: dfn;
15
- urlPrefix: #dfn-;
14
+ urlPrefix: http://heycam.github.io/webidl/; type: dfn;
15
+ text: AbortError
16
+ text: SyntaxError
17
+ urlPrefix: #idl-;
16
18
text: DOMException
17
- text: SyntaxError
19
+ urlPrefix: #dfn-;
18
20
text: inherit
19
21
urlPrefix: #es-;
20
22
text: invoking callback functions
@@ -283,6 +285,15 @@ The <a>module responses map</a> exists to ensure that {{WorkletGlobalScope}}s cr
283
285
times contain the same set of script source text and have the same behaviour. The creation of
284
286
additional {{WorkletGlobalScope}} s should be transparent to the author.
285
287
288
+ Note:
289
+ Practically user-agents aren't expected to implement the following algorithm using a
290
+ thread-safe map. Instead when {{Worklet/import}} is called user-agents can fetch the module
291
+ graph on the main thread, and send the fetched sources (the data contained in the <a>module
292
+ responses map</a> ) to each thread which has a {{WorkletGlobalScope}} .
293
+
294
+ If the user agent wishes to create a new {{WorkletGlobalScope}} it can simply sent the list of
295
+ all fetched sources from the main thread to the thread which owns the {{WorkletGlobalScope}} .
296
+
286
297
When the <dfn method for=Worklet>import(|moduleURL|)</dfn> method is called on a {{Worklet}} object,
287
298
the user agent <em> must</em> run the following steps:
288
299
1. Let |promise| be <a>a new promise</a> .
@@ -339,13 +350,16 @@ the user agent <em>must</em> run the following steps:
339
350
3. Let |script| be the result of <a>fetch a module script tree</a> when it
340
351
asynchronously completes.
341
352
353
+ If |script| is <em> null</em> reject |promise| with a "<a>AbortError</a> "
354
+ <a>DOMException</a> and abort all these steps.
355
+
342
356
4. <a>Run a module script</a> given |script|.
343
357
344
358
2. If <em> all</em> the steps above succeeded (in particular, if all of the scripts parsed
345
359
and loaded into the global scopes), resolve |promise|.
346
360
<br> Otherwise, reject |promise|.
347
361
348
- Note: Specifically, if a script fails to parse or fails to load over the network, it should
362
+ Note: Specifically, if a script fails to parse or fails to load over the network, it will
349
363
reject the promise; if the script throws an error while first evaluating the promise
350
364
should resolve as a classes may have been registered correctly.
351
365
0 commit comments