From 616df18cd9e6c17878db5167909c69ca9f9d2906 Mon Sep 17 00:00:00 2001
From: Domenic Denicola
If the result is error:
+If url is failure:
Let error be a new TypeError
exception.
script
element.
- A module map is a map of absolute URLs to values that are either a module script, null (used to +
A module map is a map of URL records to values that are either a module script, null (used to
represent failed fetches), or a placeholder value " To resolve a module specifier given a module script script
- and a string specifier, perform the following steps. It will return either an
- absolute URL or failure.fetching
". Module maps are used to ensure that imported JavaScript modules are
only fetched, parsed, and evaluated once per Document
or
Apply the URL parser to specifier. If the result is not failure, @@ -88410,14 +88410,39 @@ import "https://example.com/foo/../module2.js"; object's module map.
Let url be the result of resolving a
- module specifier given referencing module script and specifier. If
- the result is failure, then throw a TypeError
exception and abort these
- steps.
Let resolved module script be moduleMap[url]. If no such
- entry exists, or if resolved module script is null or
- "fetching
", then throw a TypeError
exception and abort these
- steps.
Assert: url is never failure, because resolving a module specifier must have been previously successful with these + same two arguments during the appropriate invocation of fetch the descendants of and + instantiate a module script.
Let resolved module script be moduleMap[url]. (This entry + must exist for us to have gotten to this point.)
If resolved module script is null, then throw a TypeError
+ exception and abort these steps.
This occurs when we have previously tried to fetch url, and failed, but are now rediscovering that fact in a new
+ module script graph. For example, given a file module.js
whose contents
+ are
import "./404.js";+ +
then we could get here as part of fetching the
+ graph for the second script
element in the following HTML:
<script type="module" src="404.js"></script> +<script type="module" src="module.js"></script>+
Assert: resolved module script is a module script (i.e., is not
+ "fetching
").
If resolved module script's state is "errored
", then throw