diff --git a/source b/source index f17c3694ad9..92ffce1972b 100644 --- a/source +++ b/source @@ -106488,10 +106488,11 @@ new PaymentRequest(…); // Allowed to use
A global object has an import map, initially an empty import map.
-For now, only Window
global
- objects have their import map modified
- from the initial empty one. The import map is
- only accessed for the resolution of a root module script.
For now, only Window
and DedicatedWorkerGlobalScope
+ global objects have their import map modified from the initial empty one. The
+ import map is only accessed for the resolution of
+ a root module script.
A global object has a resolved module set, a set
of specifier resolution records, initially
@@ -109215,12 +109216,9 @@ dictionary PromiseRejectionEventInit : EventInit
- Let importMap be an empty import map. If settingsObject's global
- object implements Let importMap be settingsObject's global object's import map. Let serializedBaseURL be baseURL, serialized. When a user agent is to run a worker for a script with Window
, then set importMap to
- settingsObject's global object's
- import map.Worker
or
SharedWorker
object worker, URL url,
environment settings object outside settings, MessagePort
- outside port, and a WorkerOptions
dictionary options, it must
- run the following steps.WorkerOptions
dictionary options, and an
+ import map importMap, it must run the following steps.
Let is shared be true if worker is a SharedWorker
@@ -120591,6 +120589,9 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope
data-x="concept-WorkerGlobalScope-name">name to the value of options's
name
member.
Set worker global scope's import map to importMap.
Append owner to worker global scope's owner set.
[Exposed=(Window,DedicatedWorker,SharedWorker)]
interface Worker : EventTarget {
- constructor((TrustedScriptURL
or USVString) scriptURL, optional WorkerOptions options = {});
+ constructor((TrustedScriptURL
or USVString) scriptURL, optional DedicatedWorkerOptions options = {});
undefined terminate();
@@ -121015,12 +121016,18 @@ interface Worker : EventTarget {
dictionary WorkerOptions {
WorkerType type = "classic";
- RequestCredentials credentials = "same-origin"; // credentials is only used if type is "module"
+ RequestCredentials credentials = "same-origin"; // credentials is only used if type is "module"
DOMString name = "";
};
+dictionary DedicatedWorkerOptions : WorkerOptions {
+ WorkerImportMapInheritance importMap = "none";
+};
+
enum WorkerType { "classic", "module" };
+enum WorkerImportMapInheritance { "none", "clone" };
+
Worker includes AbstractWorker;
Worker includes MessageEventTarget;
@@ -121108,6 +121115,27 @@ enum WorkerType { "classic", "module" };
If worker URL is failure, then throw a "SyntaxError
"
DOMException
.
Let importMap be an empty import map.
If options's importMap
member is "clone
", then:
If the current global object implements Window
or
+ DedicatedWorkerGlobalScope
, set importMap to a deep copy of the
+ current global object's import
+ map.
Else, throw a TypeError
exception.
The current global object's import map could be modified, by merging it with a new import map. Such + updates will not be reflected in the cloned import map.
+Let worker be a new Worker
object.
Let outside port be a new Run a worker given worker, worker URL, outside
- settings, outside port, and options.MessagePort
in outside
@@ -121123,7 +121151,7 @@ enum WorkerType { "classic", "module" };
, outside port options, and importMap.
[Exposed=Window]
interface SharedWorker : EventTarget {
- constructor((TrustedScriptURL
or USVString) scriptURL, optional (DOMString or WorkerOptions) options = {});
+ constructor((TrustedScriptURL
or USVString) scriptURL, optional (DOMString or SharedWorkerOptions) options = {});
readonly attribute MessagePort port;
};
+
+dictionary SharedWorkerOptions : WorkerOptions {
+ any importMap; // used to prevent passing DedicatedWorkerOptions' importMap option
+};
+
SharedWorker includes AbstractWorker;
script
".
If options is a DOMString
, set
- options to a new WorkerOptions
dictionary whose options to a new
SharedWorkerOptions
dictionary whose name
member is set to the value of options and whose other members
are set to their default values.
If urlRecord is failure, then throw a "SyntaxError
"
DOMException
.
If options's importMap
member is not undefined, throw
+ a TypeError
exception.
Let worker be a new SharedWorker
object.
Let outside port be a new MessagePort
in outside
@@ -121338,8 +121374,8 @@ interface SharedWorker : EventTarget {
Otherwise, in parallel, run a worker given worker, - urlRecord, outside settings, outside port, and - options.