You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Create a new {{WorkerLocation}} object and associate it with |workerGlobalScope|.
2941
2947
1. If the <a>run CSP initialization for a global object</a> algorithm returns "<code>Blocked</code>" when executed upon |workerGlobalScope|, set |startFailed| to true and abort these steps.
2942
2948
1. If |serviceWorker| is an <a>active worker</a>, and there are any <a>tasks</a> queued in |serviceWorker|'s <a>containing service worker registration</a>'s [=service worker registration/task queues=], <a lt="queue a task">queue</a> them to |serviceWorker|'s <a>event loop</a>'s [=/task queues=] in the same order using their original <a>task sources</a>.
2943
-
1. Let |evaluationStatus| be the result of <a lt="run a classic script">running the classic script</a> |script| if |script| is a <a>classic script</a>, otherwise, the result of <a lt="run a module script">running the module script</a> |script| if |script| is a [=module script=].
2944
-
1. If |evaluationStatus|.\[[Value]] is empty, this means the script was not evaluated. Set |startFailed| to true and abort these steps.
2949
+
1. Let |evaluationStatus| be null.
2950
+
1. If |script| is a [=classic script=], then:
2951
+
1. Set |evaluationStatus| to the result of [=run a classic script|running the classic script=] |script|.
2952
+
1. If |evaluationStatus|.\[[Value]] is empty, this means the script was not evaluated. Set |startFailed| to true and abort these steps.
2953
+
1. Otherwise, if |script| is a [=module script=], then:
2954
+
1. Let |evaluationPromise| be the result of [=run a module script|running the module script=] |script|, with report errors set to false.
2955
+
1. Assert: |evaluationPromise|.\[[PromiseState]] is not "pending".
2956
+
1. If |evaluationPromise|.\[[PromiseState]] is "rejected":
2957
+
1. Set |evaluationStatus| to [$ThrowCompletion$](|evaluationPromise|.\[[PromiseResult]]).
2958
+
1. Otherwise:
2959
+
1. Set |evaluationStatus| to [$NormalCompletion$](undefined).
2945
2960
1. If the script was aborted by the [=Terminate Service Worker=] algorithm, set |startFailed| to true and abort these steps.
2946
2961
1. Set |serviceWorker|'s [=start status=] to |evaluationStatus|.
2947
2962
1. If |script|'s <a>has ever been evaluated flag</a> is unset, then:
Note: When an exception is [=throw|thrown=], the implementation does undo (roll back) any changes made to the cache storage during the batch operation job.
0 commit comments