diff --git a/source b/source index 93b3e26ee37..c1d9e982803 100644 --- a/source +++ b/source @@ -2757,6 +2757,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • a promise resolved with
  • a promise rejected with
  • upon rejection
  • +
  • upon fulfillment
  • [LegacyFactoryFunction]
  • [LegacyLenientThis]
  • [LegacyNullToEmptyString]
  • @@ -2888,8 +2889,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The Script Record specification type
  • The Cyclic Module Record specification type
  • The Source Text Module Record specification type and its - Evaluate and - Link methods
  • + Evaluate, + Link and + LoadRequestedModules methods
  • The ArrayCreate abstract operation
  • The Call abstract operation
  • @@ -2903,6 +2905,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The DetachArrayBuffer abstract operation
  • The EnumerableOwnProperties abstract operation
  • The FinishDynamicImport abstract operation
  • +
  • The FinishLoadingImportedModule abstract operation
  • The OrdinaryFunctionCreate abstract operation
  • The Get abstract operation
  • The GetActiveScriptOrModule abstract operation
  • @@ -2913,10 +2916,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The HostEnqueuePromiseJob abstract operation
  • The HostEnsureCanAddPrivateElement abstract operation
  • The HostEnsureCanCompileStrings abstract operation
  • -
  • The HostImportModuleDynamically abstract operation
  • +
  • The HostLoadImportedModule abstract operation
  • The HostMakeJobCallback abstract operation
  • The HostPromiseRejectionTracker abstract operation
  • -
  • The HostResolveImportedModule abstract operation
  • The InitializeHostDefinedRealm abstract operation
  • The IsAccessorDescriptor abstract operation
  • The IsCallable abstract operation
  • @@ -95927,10 +95929,10 @@ document.querySelector("button").addEventListener("click", bound); sequence containing the response body. isTopLevel will be true for all classic script fetches, and for the initial fetch when fetching an external module script graph, fetching a module worker script graph, or fetching an import() module script graph, but false for the fetches - resulting from import statements encountered throughout the graph.

    + script graph">fetching an external module script graph or fetching a module worker script graph, but false for the fetches + resulting from import statements encountered throughout the graph or from + import() expressions.

    By default, not supplying a perform the fetch hook will cause the below algorithms to simply fetch @@ -96214,58 +96216,9 @@ document.querySelector("button").addEventListener("click", bound);

  • If result is null, run onComplete given null, and abort these steps.

  • -
  • Let visited set be « (url, "javascript") - ».

  • -
  • Fetch the descendants of and link result given settings object, "script", visited set, and onComplete.

  • - - - - -

    To fetch an import() module script graph given a moduleRequest, a - script, a settings object, some options, and an - onComplete algorithm, run these steps. onComplete must be an algorithm - accepting null (on failure) or a module script (on success).

    - -
      -
    1. Disallow further import maps given settings object.

    2. - -
    3. Let url be the result of resolving a - module specifier given script and moduleRequest.[[Specifier]], - catching any exceptions.

    4. - -
    5. If the previous step threw an exception, then run onComplete given null, and - return.

    6. - -
    7. Assert: moduleRequest.[[Assertions]] does not contain any - Record entry such that entry.[[Key]] is not "type", because we only asked for "type" assertions in - HostGetSupportedImportAssertions.

    8. - -
    9. Let moduleType be the result of running the module type from module - request steps given moduleRequest.

    10. - -
    11. If the result of running the module type allowed steps given - moduleType and settings object is false, then run onComplete - given null, and return.

    12. - -
    13. -

      Fetch a single module script given url, settings - object, "script", options, settings object, - "client", moduleRequest, true, and with the following steps - given result:

      - -
        -
      1. If result is null, run onComplete with null, and abort these - steps.

      2. - -
      3. Let visited set be « (url, moduleType) ».

      4. - -
      5. Fetch the descendants - of and link result given settings object, destination, - visited set, and onComplete.

      6. + data-x="">script", and onComplete.

    @@ -96288,18 +96241,11 @@ document.querySelector("button").addEventListener("click", bound);
  • Run onComplete given result.

  • -

    If result is not null, optionally perform the following steps:

    - -
      -
    1. Let visited set be « (url, "javascript") - ».

    2. - -
    3. Fetch the - descendants of and link result given settings object, - destination, visited set, and with an empty algorithm.

    4. -
    +

    If result is not null, optionally fetch the descendants of and link result given + settings object, destination, and an empty algorithm.

    -

    Generally, performing these steps will be beneficial for performance, as it +

    Generally, performing this step will be beneficial for performance, as it allows pre-loading the modules that will invariably be requested later, via algorithms such as fetch an external module script graph that fetch the entire graph. However, user agents might wish to skip them in bandwidth-constrained situations, or situations where the @@ -96323,12 +96269,9 @@ document.querySelector("button").addEventListener("click", bound);

  • If script is null, run onComplete given null, and return.

  • -
  • Let visited set be an empty set.

  • - -
  • Fetch the - descendants of and link script, given settings object, the - destination "script", visited set, and - onComplete.

  • +
  • Fetch the descendants of + and link script, given settings object, "script", and onComplete.

  • To fetch a module worker script graph @@ -96398,28 +96341,7 @@ document.querySelector("button").addEventListener("click", bound);

    This diagram illustrates how these algorithms relate to the ones above, as well as to each other:

    - - - + @@ -96437,7 +96359,7 @@ document.querySelector("button").addEventListener("click", bound); - fetch an import() module script graph + fetch a modulepreload module script graph @@ -96445,42 +96367,34 @@ document.querySelector("button").addEventListener("click", bound); - fetch a modulepreload module script graph + fetch an inline module script graph - - - fetch an inline module script graph - - - - - fetch a module worker script graph - + - + fetch a worklet script graph - + - + fetch a worklet/module worker script graph - + @@ -96488,23 +96402,6 @@ document.querySelector("button").addEventListener("click", bound); fetch the descendants of and link a module script - - - - - - fetch the descendants of a module script - - - - - - - - internal module script graph fetching procedure - - -

    To fetch a worklet/module worker script graph given a url, a fetch @@ -96536,211 +96433,86 @@ document.querySelector("button").addEventListener("click", bound);

  • If result is null, run onComplete given null, and abort these steps.

  • -
  • Let visited set be « (url, "javascript") - ».

  • - -
  • Fetch the - descendants of and link result given fetch client settings - object, destination, visited set, and - onComplete. If performFetch was given, pass it along as well.

  • +
  • Fetch the descendants + of and link result given fetch client settings object, + destination, and onComplete. If performFetch was given, pass + it along as well.

  • To fetch the descendants of and link a module script module - script, given a fetch client settings object, a destination, a - visited set, an onComplete algorithm, and an optional perform the fetch hook performFetch, run - these steps. onComplete must be an algorithm accepting null (on failure) or a - module script (on success).

    - -
      -
    1. -

      Fetch the descendants of - module script, given fetch client settings object, destination, - visited set, and onFetchDescendantsComplete as defined below. If - performFetch was given, pass it along as well.

      - -

      onFetchDescendantsComplete given result is the following algorithm:

      - -
        -
      1. -

        If result is null, then run onComplete given result, and - abort these steps.

        - -

        In this case, there was an error fetching one or more of the descendants. We - will not attempt to link.

        -
      2. - -
      3. Let parse error be the result of finding the first parse error - given result.

      4. - -
      5. -

        If parse error is null, then:

        - -
          -
        1. Let record be result's record.

        2. - -
        3. -

          Perform record.Link().

          - -

          This step will recursively call Link on all of - the module's unlinked dependencies.

          - -

          If this throws an exception, set result's error to rethrow to that exception.

          -
        4. -
        -
      6. - -
      7. Otherwise, set result's error - to rethrow to parse error.

      8. - -
      9. Run onComplete given result.

      10. -
      -
    2. -
    - -

    To fetch the descendants of a module script module script, given a - fetch client settings object, a destination, a visited set, an + script, given a fetch client settings object, a destination, an onComplete algorithm, and an optional perform the fetch hook performFetch, run these steps. onComplete must be an algorithm accepting null (on failure) or a module script (on success).

      -
    1. If module script's record is null, - run onComplete with module script and return.

    2. -
    3. Let record be module script's record.

    4. -
    5. If record is not a Cyclic Module Record, or if - record.[[RequestedModules]] is empty, run - onComplete with module script and return.

    6. - -
    7. Let moduleRequests be a new empty list.

    8. -
    9. -

      For each ModuleRequest Record - requested of record.[[RequestedModules]],

      +

      If record is null, then:

        -
      1. Let url be the result of resolving - a module specifier given module script and - requested.[[Specifier]].

      2. - -
      3. Assert: the previous step never throws an exception, because resolving a module specifier must have been previously successful with these same two - arguments.

      4. +
      5. Set module script's error to + rethrow to module script's parse error.

      6. -
      7. Let moduleType be the result of running the module type from module - request steps given requested.

      8. - -
      9. -

        If visited set does not contain - (url, moduleType), then:

        +
      10. Run onComplete given module script.

      11. -
          -
        1. Append requested to - moduleRequests.

        2. - -
        3. Append (url, moduleType) to - visited set.

        4. -
        - +
      12. Return.

    10. -
    11. Let options be the descendant script fetch options for module - script's fetch options.

    12. - -
    13. Assert: options is not null, as module script is a - JavaScript module script.

    14. +
    15. Let state be Record { [[ParseError]]: null, [[Destination]]: + destination, [[PerformFetch]]: null }.

    16. -
    17. Let pendingCount be the length of moduleRequests.

    18. +
    19. If performFetch was given, set state.[[PerformFetch]] to + performFetch.

    20. -
    21. If pendingCount is zero, run onComplete with module - script.

    22. +
    23. +

      Let loadingPromise be record.LoadRequestedModules(state).

      -
    24. Let failed be false.

    25. +

      This step will recursively load all the module transitive dependencies.

      +
    26. -

      For each moduleRequest in - moduleRequests, perform the internal module script graph fetching - procedure given moduleRequest, fetch client settings object, - destination, options, module script, visited set, - and onInternalFetchingComplete as defined below. If performFetch was - given, pass it along as well.

      - -

      onInternalFetchingComplete given result is the following algorithm:

      +

      Upon fulfillment of loadingPromise, run the following steps:

        -
      1. If failed is true, then abort these steps.

      2. - -
      3. If result is null, then set failed to true, run - onComplete with null, and abort these steps.

      4. +
      5. +

        Perform record.Link().

        -
      6. Assert: pendingCount is greater than zero.

      7. +

        This step will recursively call Link on all of + the module's unlinked dependencies.

        -
      8. Decrement pendingCount by one.

      9. +

        If this throws an exception, catch it, and set module script's error to rethrow to that exception.

        + -
      10. If pendingCount is zero, run onComplete with module - script.

      11. +
      12. Run onComplete given module script.

      - -

      The fetches performed by the internal module script graph fetching - procedure are performed in parallel to each other.

    27. -
    - -

    To perform the internal module script graph fetching procedure given a - moduleRequest, a fetch client settings object, a destination, - some options, a referringScript, a visited set, an - onComplete algorithm, and an optional perform the fetch hook performFetch, run - these steps. onComplete must be an algorithm accepting null (on failure) or a - module script (on success).

    - -
      -
    1. Let url be the result of resolving - a module specifier given referringScript and - moduleRequest.[[Specifier]].

    2. - -
    3. Assert: the previous step never throws an exception, because resolving a module specifier must have been previously successful with these same two - arguments.

    4. - -
    5. Let moduleType be the result of running the module type from module - request steps given moduleRequest.

    6. - -
    7. Assert: visited set contains - (url, moduleType).

    8. -

      Fetch a single module script given url, fetch client settings - object, destination, options, referringScript's - settings object, referringScript's base URL, moduleRequest, false, and - onSingleFetchComplete as defined below. If performFetch was given, pass - it along as well.

      - -

      onSingleFetchComplete given result is the following algorithm:

      +

      Upon rejection of loadingPromise, run the + following steps:

        -
      1. If result is null, run onComplete with null, and abort these - steps.

      2. +
      3. If state.[[ParseError]] is not null, set module script's error to rethrow to + state.[[ParseError]] and run onComplete given module + script.

      4. -
      5. Fetch the descendants of - result given fetch client settings object, destination, - visited set, and with onComplete. If performFetch was given, - pass it along as well.

      6. -
      +
    9. +

      Otherwise, run onComplete given null.

      -

      +

      state.[[ParseError]] is null when loadingPromise is + rejected due to a loading error.

      +
    10. +
    @@ -96759,12 +96531,11 @@ document.querySelector("button").addEventListener("click", bound); running the module type from module request steps given moduleRequest.

    -
  • Assert: the result of running the module type allowed steps - given moduleType and module map settings object is true. Otherwise we would - not have reached this point because a failure would have been raised when inspecting - moduleRequest.[[Assertions]] in create a JavaScript module script or - fetch an import() module script graph.

  • +
  • Assert: the result of running the module type allowed steps given + moduleType and module map settings object is true. Otherwise we would not + have reached this point because a failure would have been raised when inspecting + moduleRequest.[[Assertions]] in create + a JavaScript module script or fetch a single imported module script.

  • Let moduleMap be module map settings object's module map.

  • @@ -96876,61 +96647,30 @@ document.querySelector("button").addEventListener("click", bound); -

    To find the first parse error given a root - moduleScript and an optional discoveredSet:

    +

    To fetch a single imported module script, given a url, a settings + object, a destination, some options, a referrer, a + moduleRequest, an onComplete algorithm, and an optional perform the fetch hook performFetch, run + these steps. onComplete must be an algorithm accepting null (on failure) or a + module script (on success).

      -
    1. Let moduleMap be moduleScript's settings object's - module map.

    2. - -
    3. If discoveredSet was not given, let it be an empty set.

    4. - -
    5. Append moduleScript to - discoveredSet.

    6. - -
    7. If moduleScript's record is null, - then return moduleScript's parse - error.

    8. - -
    9. If moduleScript's record is not a - Cyclic Module Record, then return null.

    10. - -
    11. Let moduleRequests be the value of moduleScript's record's [[RequestedModules]] internal slot.

    12. - -
    13. -

      For each moduleRequest of - moduleRequests:

      - -
        -
      1. Let childURL be the result of resolving a module specifier given moduleScript and - moduleRequest.[[Specifier]]. (This will never throw an exception, as otherwise - moduleScript would have been marked - as itself having a parse error.)

      2. - -
      3. Let moduleType be the result of running the module type from module - request steps given moduleRequest.

      4. - -
      5. Let childModule be moduleMap[(childURL, - moduleType)].

      6. - -
      7. Assert: childModule is a module script (i.e., it is - not "fetching" or null); by now all module - scripts in the graph rooted at moduleScript will have successfully been - fetched.

      8. - -
      9. If discoveredSet already contains - childModule, continue.

      10. +
      11. Assert: moduleRequest.[[Assertions]] does not contain any Record + entry such that entry.[[Key]] is not "type", because + we only asked for "type" assertions in + HostGetSupportedImportAssertions.

      12. -
      13. Let childParseError be the result of finding the first parse - error given childModule and discoveredSet.

      14. +
      15. Let moduleType be the result of running the module type from module + request steps given moduleRequest.

      16. -
      17. If childParseError is not null, return childParseError.

      18. -
      -
    14. +
    15. If the result of running the module type allowed steps given + moduleType and settings object is false, then run onComplete + given null, and return.

    16. -
    17. Return null.

    18. +
    19. Fetch a single module script given url, settings + object, destination, options, settings object, + referrer, moduleRequest, false, and onComplete. If + performFetch was given, pass it along as well.

    Creating scripts
    @@ -97117,7 +96857,7 @@ document.querySelector("button").addEventListener("click", bound);

    Run the steps to synchronously replace the rules of a CSSStyleSheet on sheet given source.

    -

    If this throws an exception, set script's If this throws an exception, catch it, and set script's parse error to that exception, and return script.

    @@ -97152,7 +96892,7 @@ document.querySelector("button").addEventListener("click", bound);
  • Let result be ParseJSONModule(source).

    -

    If this throws an exception, set script's If this throws an exception, catch it, and set script's parse error to that exception, and return script.

  • @@ -98822,9 +98562,8 @@ dictionary PromiseRejectionEventInit : EventInitAs a consequence, this means that when the import() expression is evaluated, there will still be no active script. Fortunately that is handled by our - implementations of HostResolveImportedModule and - HostImportModuleDynamically, by falling back to using the current settings - object's API base URL.

    + implementation of HostLoadImportedModule by falling back to using the + current settings object's API base URL.

    @@ -98860,8 +98599,8 @@ dictionary PromiseRejectionEventInit : EventInit.

    The returned promise will be rejected if an invalid specifier is given, or if a failure is - encountered while fetching or evaluating the resulting module graph.

    + encountered while fetching or evaluating the + resulting module graph.

    This syntax can be used inside both classic and module scripts. It thus provides a bridge into the module-script @@ -98945,8 +98684,8 @@ import "https://example.com/foo/../module2.mjs";

    This can result in two separate fetches and two separate module evaluations being performed. This is a willful violation of a constraint recommended (but not required) by the - import assertions specification stating that each call to HostResolveImportedModule - with the same (referencingScriptOrModule, moduleRequest.[[Specifier]]) pair + import assertions specification stating that each call to HostLoadImportedModule + with the same (referrer, moduleRequest.[[Specifier]]) pair must return the same Module Record.

    @@ -99018,169 +98757,185 @@ import "https://example.com/foo/../module2.mjs";
  • Let resolveFunction be ! CreateBuiltinFunction(steps, 1, "resolve", « »).

  • -
  • Return « Record { [[Key]]: "url", - [[Value]]: urlString }, Record { [[Key]]: "

    Return « Record { [[Key]]: "url", + [[Value]]: urlString }, Record { [[Key]]: "resolve", [[Value]]: resolveFunction } ».

  • -
    HostImportModuleDynamically(referencingScriptOrModule, - moduleRequest, promiseCapability)
    +
    HostGetSupportedImportAssertions()
    + +

    The Import Assertions proposal contains an implementation-defined + HostGetSupportedImportAssertions + abstract operation. User agents must use the following implementation:

    + +
      +
    1. Return « "type" ».

    2. +
    + +
    HostLoadImportedModule(referrer, + moduleRequest, loadState, payload)

    JavaScript contains an implementation-defined HostImportModuleDynamically abstract operation. - User agents must use the following implementation:

    + data-x="js-HostLoadImportedModule">HostLoadImportedModule
    abstract operation. User agents + must use the following implementation:

    + +

    This specification expects the second parameter to be a ModuleRequest + Record, instead of a string as specified by ECMA-262. This is under the assumption that the + import assertions proposal, when updated to use HostLoadImportedModule + instead of the previous module loading hooks, will update the abstract operation passing a + ModuleRequest Record.

      -
    1. Let settings object be the current settings object.

    2. +
    3. Let settingsObject be the current settings object.

    4. -

      If settings object's global - object implements WorkletGlobalScope or - ServiceWorkerGlobalScope, then:

      +

      If settingsObject's global + object implements WorkletGlobalScope or ServiceWorkerGlobalScope + and loadState is undefined, then:

      + +

      loadState is undefined when the current fetching process has been + initiated by a dynamic import() call, either directly or when loading the + transitive dependencies of the dynamically imported module.

        -
      1. Let completion be Completion { [[Type]]: throw, [[Value]]: a new - TypeError, [[Target]]: empty }.

      2. +
      3. Let completion be Completion Record { [[Type]]: throw, + [[Value]]: a new TypeError, [[Target]]: empty }.

      4. -
      5. Perform FinishDynamicImport(referencingScriptOrModule, - moduleRequest, promiseCapability, completion).

      6. +
      7. Perform FinishLoadingImportedModule(referrer, + moduleRequest, payload, completion).

      8. Return.

    5. -
    6. Let referencing script be null.

    7. +
    8. Let referencingScript be null.

    9. -
    10. Let fetch options be the default classic script fetch +

    11. Let fetchOptions be the default classic script fetch options.

    12. +
    13. Let fetchReferrer be "client".

    14. +
    15. -

      If referencingScriptOrModule is not null, then:

      +

      If referrer is a Script Record or a Module Record, then:

        -
      1. Set referencing script to - referencingScriptOrModule.[[HostDefined]].

        +
      2. Set referencingScript to referrer.[[HostDefined]].

        -
      3. Set settings object to referencing script's settings +

      4. Set settingsObject to referencingScript's settings object.

      5. -
      6. Set fetch options to the descendant script fetch options for - referencing script's fetch +

      7. Set fetchOptions to the descendant script fetch options for + referencingScript's fetch options.

      8. -
      9. Assert: fetch options is not null, as referencing - script is a classic script or a JavaScript module +

      10. Assert: fetchOptions is not null, as + referencingScript is a classic script or a JavaScript module script.

      11. -
      - -

      As explained for HostResolveImportedModule, in the common - case, referencingScriptOrModule is non-null.

      -
    16. -
    17. -

      Fetch an import() module script graph given moduleRequest, - referencing script, settings object, fetch options, and with - the following steps given result:

      +
    18. +

      If neither of the following conditions are true:

      -
        -
      1. Let promise be null. +

          +
        • referrer is a Script Record; or
        • -
        • If result is null, then set promise to a promise rejected - with a new TypeError.

        • +
        • referrer is a Module Record and + referrer.[[Status]] is one of evaluating, evaluating-async or evaluated,
        • +
        -
      2. Otherwise, set promise to the result of running a module script given result and true.

      3. +

        then set fetchReferrer to referrer's base URL.

        -
      4. Perform FinishDynamicImport(referencingScriptOrModule, - moduleRequest, promiseCapability, promise).

      5. +

        We set fetchReferrer conditionally to not propagate the referrer + when using import(). Issue + #3744 looks into aligning dynamic imports with static imports.

        +
      -
    19. -
    - -
    HostResolveImportedModule(referencingScriptOrModule, - moduleRequest)
    -

    JavaScript contains an implementation-defined HostResolveImportedModule abstract operation. User - agents must use the following implementation:

    +
    +

    referrer is usually a Script Record or a Module Record, but it will not be so for event handlers per the get the current value of the event + handler algorithm. For example, given:

    -
      -
    1. Let moduleMap and referencingScript be null.

    2. +
      <button onclick="import('./foo.mjs')">Click me</button>
      -
    3. -

      If referencingScriptOrModule is not null, then:

      +

      If a click event occurs, then at the time the + import() expression runs, GetActiveScriptOrModule will return null, + and this operation will receive the current realm as a fallback + referrer.

      +
    + -
      -
    1. Set referencingScript to - referencingScriptOrModule.[[HostDefined]].

    2. +
    3. Disallow further import maps given settingsObject.

    4. -
    5. Set moduleMap to referencingScript's settings - object's module map.

    6. -
    - +
  • Let url be the result of resolving a + module specifier given referencingScript and + moduleRequest.[[Specifier]], catching any exceptions. If they throw an exception, let + resolutionError be the thrown exception.

  • -

    Otherwise:

    +

    If the previous step threw an exception, then:

      -
    1. Assert: there is a current settings object.

    2. +
    3. Let completion be Completion Record { [[Type]]: throw, + [[Value]]: resolutionError, [[Target]]: empty }.

    4. -
    5. Set moduleMap to the current settings object's module map.

    6. -
    +
  • Perform FinishLoadingImportedModule(referrer, + moduleRequest, payload, completion).

  • -
    -

    referencingScriptOrModule is not usually null, but will be so for event handlers - per the get the current value of - the event handler algorithm. For example, given:

    +
  • Return.

  • + + -
    <button onclick="import('./foo.mjs')">Click me</button>
    +
  • Let destination be "script".

  • -

    If a click event occurs, then at the time the - import() expression runs, GetActiveScriptOrModule will return null, - which will be passed to this abstract operation when HostResolveImportedModule is called by - FinishDynamicImport.

    -
    - +
  • If loadState is not undefined, then set destination to + loadState.[[Destination]].

  • -
  • Let url be the result of resolving a - module specifier given referencingScript and - moduleRequest.[[Specifier]].

  • +
  • +

    Fetch a single imported module script given url, settings + object, destination, fetchOptions, fetchReferrer, + moduleRequest, and onSingleFetchComplete as defined below. If + loadState is not undefined and loadState.[[PerformFetch]] is not null, + pass loadState.[[PerformFetch]] along as well.

    -
  • Assert: the previous step never throws an exception, because resolving a module specifier must have been - previously successful with these same two arguments (either while creating the corresponding module script, - or in fetch an import() module script graph).

  • +

    onSingleFetchComplete given moduleScript is the following + algorithm:

    -
  • Let moduleType be the result of running the module type from module - request steps given moduleRequest.

  • +
      +
    1. Let completion be null.

    2. -
    3. Let resolvedModuleScript be moduleMap[(url, - moduleType)]. (This entry must exist for us to have - gotten to this point.)

    4. +
    5. If moduleScript is null, then set completion to Completion + Record { [[Type]]: throw, [[Value]]: a new TypeError, [[Target]]: empty + }.

    6. -
    7. Assert: resolvedModuleScript is a module script - (i.e., is not null or "fetching").

    8. +
    9. +

      Otherwise, if moduleScript's parse + error is not null, then:

      -
    10. Assert: resolvedModuleScript's record is not null.

      +
        +
      1. Let parseError be moduleScript's parse error.

      2. -
      3. Return resolvedModuleScript's record.

      4. -
      +
    11. Set completion to Completion Record { [[Type]]: throw, + [[Value]]: parseError, [[Target]]: empty }.

    12. -
      HostGetSupportedImportAssertions()
      +
    13. If loadState is not undefined and loadState.[[ParseError]] is + null, set loadState.[[ParseError]] to parseError.

    14. +
    + -

    The Import Assertions proposal contains an implementation-defined - HostGetSupportedImportAssertions - abstract operation. User agents must use the following implementation:

    +
  • Otherwise, set completion to Completion Record { [[Type]]: + normal, [[Value]]: result's record, + [[Target]]: empty }.

  • -
      -
    1. Return « "type" ».

    2. +
    3. Perform FinishLoadingImportedModule(referrer, + moduleRequest, payload, completion).

    4. +
    + @@ -101148,9 +100903,8 @@ typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnl

    In practice, this only affects the resolution of relative URLs via import(), which consult the base URL of the associated - script. Nulling out [[ScriptOrModule]] means that HostResolveImportedModule and - HostImportModuleDynamically will fall back to the current settings - object's API base URL.

    + script. Nulling out [[ScriptOrModule]] means that HostLoadImportedModule will + fall back to the current settings object's API base URL.

    diff --git a/styles.css b/styles.css index 5ad4abcc5c3..706560cec4f 100644 --- a/styles.css +++ b/styles.css @@ -111,6 +111,32 @@ td.eg { border-width: thin; text-align: center; } #abstractimg .horizontal, #abstractimg .left { word-spacing: 12px; font-size: 18px; text-anchor: middle; } #abstractimg .right { font-size: 25px; } +#module-script-fetching-diagram { + display: block; + margin: 0 auto; + width: 100%; + max-width: 1024px; +} + +#module-script-fetching-diagram rect { + stroke: black; + fill: transparent; +} + +#module-script-fetching-diagram path { + stroke: black; +} +#module-script-fetching-diagram path[marker-end] { + fill: transparent; +} + +#module-script-fetching-diagram a { + text-align: center; + display: flex; + align-items: center; + justify-content: center; +} + .jake-diagram { border-style: hidden none hidden hidden; table-layout: fixed;