diff --git a/source b/source index 1da48e1da84..346abeebf4c 100644 --- a/source +++ b/source @@ -8328,6 +8328,16 @@ interface DOMStringList { +
Otherwise, if value has [[ModuleBlockBody]] internal slot, then:
+ +Set serialized to { [[Type]]: "ModuleBlock", + [[ModuleBlockBody]]: value.[[ModuleBlockBody]], + [[HostDefined]]: value.[[HostDefined]] }.
Otherwise, if value has an [[ErrorData]] internal slot and value is not a platform object, then:
@@ -8722,6 +8732,17 @@ o.myself = o;Otherwise, if serialized.[[Type]] is "ModuleBlock", then:
+ +Set value to a new ModuleBlock object in targetRealm + whose [[ModuleBlockBody]] internal slot value is value.[[ModuleBlockBody]] + and whose [[HostDefined]] internal slot value is value.[[HostDefined]].
Otherwise, if serialized.[[Type]] is "Array", then:
@@ -90909,43 +90930,52 @@ document.querySelector("button").addEventListener("click", bound); script (on success).Let url be the result of resolving a
+ Let specifier be the result of resolving a
module specifier given base URL and moduleRequest.[[Specifier]]. If url is failure, then asynchronously complete this algorithm with null, and
- return. If specifier is a module block, then: Let source text be specifier.[[ModuleBlockBody]]. Assert: moduleRequest.[[Assertions]] does not contain any Record
- entry such that entry.[[Key]] is not " Let module block base URL be specifier.[[HostDefined]]. If moduleRequest.[[Assertions]] has a Record entry
- such that entry.[[Key]] is " Let result be the result of creating a module script using
+ source text, settings object, module block base URL, and
+ options. If module type is not " Set moduleMap[specifier] to module script. else: Assert: moduleRequest.[[Assertions]] does not contain any Record
+ entry such that entry.[[Key]] is not " Fetch a single module script given url, settings
- object, " If moduleRequest.[[Assertions]] has a Record entry
+ such that entry.[[Key]] is " If result is null, asynchronously complete this algorithm with null, and
- return. If module type is not " Let visited set be « (url, module type) ». Fetch a single module script given url, settings
+ object, " Fetch the
- descendants of and link result given settings object,
- destination, and visited set. When this asynchronously completes with
- final result, asynchronously complete this algorithm with final
- result. Let visited set be « (url, module type) ». Fetch the
+ descendants of and link result given settings object,
+ destination, and visited set. When this asynchronously completes with
+ final result, asynchronously complete this algorithm with final
+ result.
+
+ type
", because
- we only asked for "type
" assertions in
- HostGetSupportedImportAssertions.type
", then let module
- type be entry.[[Value]]. Otherwise let module type be "javascript
".javascript
", "css
", or "json
", then asynchronously complete this
- algorithm with null, and return.
+
- type
", because
+ we only asked for "type
" assertions in
+ HostGetSupportedImportAssertions.script
", options, settings object,
- "client
", moduleRequest, and with the
- top-level module fetch flag set. If the caller of this algorithm specified custom
- perform the fetch steps, pass those along as
- well. Wait until the algorithm asynchronously completes with result.type
", then let module
+ type be entry.[[Value]]. Otherwise let module type be "javascript
".javascript
", "css
", or "json
", then asynchronously complete this
+ algorithm with null, and return.script
", options, settings object,
+ "client
", moduleRequest, and with the
+ top-level module fetch flag set. If the caller of this algorithm specified custom
+ perform the fetch steps, pass those along as
+ well. Wait until the algorithm asynchronously completes with result.
To fetch a modulepreload module script graph given a url, a
@@ -92626,15 +92656,25 @@ dictionary PromiseRejectionEventInit : EventInit
A module map is a map keyed by tuples consisting of a URL record and a string.
- The URL record is the request URL at which
- the module was fetched, and the string indicates the type of the module (e.g. "javascript
"). The module map's values are either a module
- script, null (used to represent failed fetches), or a placeholder value "fetching
". Module maps are used to ensure
- that imported module scripts are only fetched, parsed, and evaluated once per
+ data-x="tuple">tuples
A URL record or a module block.
A string.
The URL record is the request URL
+ at which the module was fetched, and the string indicates the type of the module
+ (e.g. "javascript
"). The module map's values are either a
+ module script, null (used to represent failed fetches), or a placeholder value
+ "fetching
". Module maps are used
+ to ensure that imported module scripts are only fetched, parsed, and evaluated once per
Document
or worker.
The module map is a weak map. The entries where tuple key has a module block are weakly held, + but tuple keys with the URL record keys are strongly held. This is because module block + instances may be collected throughout the lifetime of a realm.
+Since module maps are keyed by (URL, module type), the following code will create three separate entries in the module map, since it @@ -92951,6 +92991,26 @@ import "https://example.com/foo/../module2.mjs";
Return resolved module script's record.
JavaScript contains an implementation-defined HostIntializeModuleBlock abstract operation. User + agents must use the following implementation:
+ +Let urlString be null.
If active script is not null, then:
+If active script's base URL is not null, then:
Let urlString be active script's base URL, serialized.
Set the moduleBlock.[[HostDefined]] to urlString.