diff --git a/source b/source index 5fa9b11f48a..8aecc619931 100644 --- a/source +++ b/source @@ -2799,6 +2799,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
url = import.meta .url
url = import.meta.url
Returns the active module script's PromiseRejectionEventInit : EventInitThis syntax can only be used inside module scripts.
url = import.meta.resolve(specifier)
Returns specifier, resolved
+ relative to the active script's base
+ URL. That is, this returns the URL that would be imported by using import(specifier)
.
Throws a TypeError
exception if an invalid specifier is given.
This syntax can only be used inside module scripts.
+A module map is a map keyed by User agents must use the following implementation:
Let module script be moduleRecord.[[HostDefined]].
Let moduleScript be moduleRecord.[[HostDefined]].
Assert: module script's base
- URL is not null, as module script is a JavaScript module
+ Assert: moduleScript's base
+ URL is not null, as moduleScript is a JavaScript module
script. Let urlString be module script's Let urlString be moduleScript's base URL, serialized. Return « Record { [[Key]]: "url", [[Value]]: urlString } ». Let steps be the following steps, given the argument specifier: Set specifier to ? ToString(specifier). Let url be the result of resolving
+ a module specifier given moduleScript's base URL and specifier. If url is failure, then throw a Return the serialization of
+ url. Let resolveFunction be ! CreateBuiltinFunction(steps, 1,
+ " Return « Record { [[Key]]: "
+
+ TypeError
exception.resolve
", « »).url
",
+ [[Value]]: urlString }, Record { [[Key]]: "resolve
", [[Value]]: resolveFunction }
+ ».