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 Window, then set importMap to - settingsObject's global object's - import map.

  • +
  • Let importMap be settingsObject's global object's import map.

  • Let serializedBaseURL be baseURL, serialized.

  • @@ -120547,8 +120545,8 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope

    When a user agent is to run a worker for a script with 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.

    + outside port, a WorkerOptions dictionary options, and an + import map importMap, it must run the following steps.

    1. 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.

    2. +
    3. Set worker global scope's import map to importMap.

    4. +
    5. Append owner to worker global scope's owner set.

    6. @@ -121005,7 +121006,7 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope
      [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" };
    7. If worker URL is failure, then throw a "SyntaxError" DOMException.

    8. +
    9. Let importMap be an empty import map.

    10. + +
    11. +

      If options's importMap member is "clone", then:

      + +
        +
      1. If the current global object implements Window or + DedicatedWorkerGlobalScope, set importMap to a deep copy of the + current global object's import + map.

      2. + +
      3. Else, throw a TypeError exception.

      4. +
      + +

      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.

      +
    12. +
    13. Let worker be a new Worker object.

    14. Let outside port be a new MessagePort in outside @@ -121123,7 +121151,7 @@ enum WorkerType { "classic", "module" };

      1. Run a worker given worker, worker URL, outside - settings, outside port, and options.

      2. + settings, outside port options, and importMap.

    15. @@ -121137,10 +121165,15 @@ enum WorkerType { "classic", "module" };
      [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;
      @@ -121193,7 +121226,7 @@ interface SharedWorker : EventTarget { "script".

    16. 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.

    17. @@ -121212,6 +121245,9 @@ interface SharedWorker : EventTarget {
    18. If urlRecord is failure, then throw a "SyntaxError" DOMException.

    19. +
    20. If options's importMap member is not undefined, throw + a TypeError exception.

    21. +
    22. Let worker be a new SharedWorker object.

    23. Let outside port be a new MessagePort in outside @@ -121338,8 +121374,8 @@ interface SharedWorker : EventTarget {

    24. Otherwise, in parallel, run a worker given worker, - urlRecord, outside settings, outside port, and - options.

    25. + urlRecord, outside settings, outside port, options, + and an empty import map.