A conforming implementation of ECMAScript should not implement Deprecated subclauses or algorithm steps, unless necessary for compatibility with existing applications that already run in such implementation before the deprecation of the given language feature. All of the language features and behaviours specified within Deprecated subclauses or algorithm steps have one or more undesirable characteristics. However, their use in existing applications currently prevents their removal from this specification. These features are not considered part of the core ECMAScript language. Programmers should not use or assume the existence of these features and behaviours when writing new ECMAScript code.
The abstract operation EvaluateImportCall takes argument specifierExpression (a ParseNode) and optional argument optionsExpression (a ParseNode) and returns either a normal completion containing a Promise or a throw completion. It performs the following steps when called:
Perform ! Call(promiseCapability.[[Reject]], undefined, « a newly created TypeError object »).
Return promiseCapability.[[Promise]].
Sort attributes according to the lexicographic order of their [[Key]] fields, treating the value of each such field as a sequence of UTF-16 code unit values. NOTE: This sorting is observable only in that hosts are prohibited from distinguishing among attributes by the order they occur in.
Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Attributes]]: attributes }.
Perform ! Call(promiseCapability.[[Reject]], undefined, « a newly created TypeError object »).
Return promiseCapability.[[Promise]].
Sort attributes according to the lexicographic order of their [[Key]] fields, treating the value of each such field as a sequence of UTF-16 code unit values. NOTE: This sorting is observable only in that hosts are prohibited from distinguishing among attributes by the order they occur in.
Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Attributes]]: attributes }.
If moduleNamesrequests does not contain name a ModuleRequest Recordmr2 such that mr.[[Specifer]] is mr2.[[Specifer]] and AttributesEqual(mr.[[Attributes]], mr2.[[Attributes]]) is true, then
If moduleNamesrequests does not contain name a ModuleRequest Recordmr2 such that mr.[[Specifer]] is mr2.[[Specifer]] and AttributesEqual(mr.[[Attributes]], mr2.[[Attributes]]) is true, then
A Cyclic Module Record is used to represent information about a module that can participate in dependency cycles with other modules that are subclasses of the Cyclic Module Record type. Module Records that are not subclasses of the Cyclic Module Record type must not participate in dependency cycles with Source Text Module Records.
A Cyclic Module Record is used to represent information about a module that can participate in dependency cycles with other modules that are subclasses of the Cyclic Module Record type. Module Records that are not subclasses of the Cyclic Module Record type must not participate in dependency cycles with Source Text Module Records.
A List of all the ModuleSpecifier strings and import attributes used by the module represented by this record to request the importation of a module. The List is in source text occurrence order.
@@ -3028,7 +2998,7 @@
A map from the specifier strings used by the module represented by this record to request the importation of a module with the relative attributes to the resolved Module Record. The list does not contain two different Records with the same [[Specifier]]([[Specifier]], [[Attributes]]) pair.
@@ -3083,8 +3053,8 @@
16.2.1.5 Cyclic Module Records
16.2.1.6 Source Text Module Records
-
An ImportEntry Record is a Record that digests information about a single declarative import. Each ImportEntry Record has the fields defined in Table 4:
An ImportEntry Record is a Record that digests information about a single declarative import. Each ImportEntry Record has the fields defined in Table 4:
If referrer.[[LoadedModules]] contains a Recordrecord such that record.[[Specifier]] is specifiermoduleRequest.[[Specifier]] and AttributesEqual(record.[[Attributes]], moduleRequest.[[Attributes]]) is true, then
Else, append the Record { [[Specifier]]: specifiermoduleRequest.[[Specifer]], [[Attributes]]: moduleRequest.[[Attributes]], [[Module]]: result.[[Value]] } to referrer.[[LoadedModules]].
If referrer.[[LoadedModules]] contains a Recordrecord such that record.[[Specifier]] is specifiermoduleRequest.[[Specifier]] and AttributesEqual(record.[[Attributes]], moduleRequest.[[Attributes]]) is true, then
Else, append the Record { [[Specifier]]: specifiermoduleRequest.[[Specifer]], [[Attributes]]: moduleRequest.[[Attributes]], [[Module]]: result.[[Value]] } to referrer.[[LoadedModules]].
The abstract operation AllImportAttributesSupported takes argument attributes (a List of ImportAttribute Records) and returns a Boolean. It performs the following steps when called:
If supported does not contain attribute.[[Key]], return false.
Return true.
+
The abstract operation AllImportAttributesSupported takes argument attributes (a List of ImportAttribute Records) and returns a Boolean. It performs the following steps when called:
Sort attributes according to the lexicographic order of their [[Key]] fields, treating the value of each such field as a sequence of UTF-16 code unit values. NOTE: This sorting is observable only in that hosts are prohibited from distinguishing among attributes by the order they occur in.
Sort attributes according to the lexicographic order of their [[Key]] fields, treating the value of each such field as a sequence of UTF-16 code unit values. NOTE: This sorting is observable only in that hosts are prohibited from distinguishing among attributes by the order they occur in.
16.2.2.4 Deprecated assert keyword for Import Attributes
Import Attributes are denoted using the withkeyword. However, there are existing implementations based on a previous version of the proposal using the assertkeyword. Due to potential web compatibility risks, the assertkeyword is still included in this specification, but its removal is being investigated.
This deprecated feature includes the assert fallback for import attributes in import calls (step 11.d of 13.3.10.2).
Sort attributes by the code point order of the [[Key]] of each element. NOTE: This sorting is observable only in that hosts are prohibited from distinguishing among attributes by the order they occur in.
Sort attributes by the code point order of the [[Key]] of each element. NOTE: This sorting is observable only in that hosts are prohibited from distinguishing among attributes by the order they occur in.
The module script would have an additional item, which would be the module type, as a string (e.g., "json"), or undefined for a JavaScript module.
-
HostLoadImportedModule would take a ModuleRequest Record parameter in place of a specifier string, which would be passed down through several abstract operations to reach the fetch a single module script algorithm. Somewhere near the entrypoint, if the ModuleRequest Record's [[Attributes]] field has an element entry such that entry.[[Key]] is "type", then let type be entry.[[Value]]; otherwise let type be undefined. If the type is invalid, then an exception is thrown and module loading fails. Otherwise, this will equal the module type, if the module can be successfully fetched with a matching MIME type.
-
In the fetch the descendents of a module script algorithm, when iterating over [[RequestedModules]], the elements are ModuleRequest Records rather than just specifier strings; these Records is passed on to the internal module script graph fetching procedure (which sends it to "fetch a single module script". Other usage sites of [[RequestedModules]] ignore the attribute.
+
HostLoadImportedModule would take a ModuleRequest Record parameter in place of a specifier string, which would be passed down through several abstract operations to reach the fetch a single module script algorithm. Somewhere near the entrypoint, if the ModuleRequest Record's [[Attributes]] field has an element entry such that entry.[[Key]] is "type", then let type be entry.[[Value]]; otherwise let type be undefined. If the type is invalid, then an exception is thrown and module loading fails. Otherwise, this will equal the module type, if the module can be successfully fetched with a matching MIME type.
+
In the fetch the descendents of a module script algorithm, when iterating over [[RequestedModules]], the elements are ModuleRequest Records rather than just specifier strings; these Records is passed on to the internal module script graph fetching procedure (which sends it to "fetch a single module script". Other usage sites of [[RequestedModules]] ignore the attribute.
"Fetch a single module script" would check the attribute in two places:
The module map is keyed with both the absolute URL and the module type, so an existing entry will be found only if its type matches.