diff --git a/index.html b/index.html
index 3bfdfef..b40b339 100644
--- a/index.html
+++ b/index.html
@@ -1335,7 +1335,12 @@
const marker = document.createElement('span');
marker.textContent = `${i < cache.length ? cache[i] : getTextForIndex(i)}. `;
marker.setAttribute('aria-hidden', 'true');
- li.prepend(marker);
+ const attributesContainer = li.querySelector('.attributes-tag');
+ if (attributesContainer == null) {
+ li.prepend(marker);
+ } else {
+ attributesContainer.insertAdjacentElement('afterend', marker);
+ }
for (const sublist of li.querySelectorAll(':scope > ol')) {
addStepNumberText(sublist, depth + 1, special);
}
@@ -1349,8 +1354,8 @@
});
});
-let sdoMap = JSON.parse(`{"prod-k77_OH1u":{"Evaluation":{"clause":"13.3.10.1","ids":["prod-DuEmEibb","prod-4N8EtSSM"]}},"prod-nQPLRauX":{"Evaluation":{"clause":"13.3.10.1","ids":["prod-OGjeE4Nc"]}},"prod-WzAgO-V_":{"ModuleRequests":{"clause":"16.2.1.3","ids":["prod-Fii3Jv-w"]}},"prod-L0spfeSo":{"ModuleRequests":{"clause":"16.2.1.3","ids":["prod-QB5EyLim"]}},"prod-OoOZVSpA":{"AttributeName":{"clause":"16.2.2.2","ids":["prod-StBELvn0"]}},"prod-CstywuHG":{"AttributeName":{"clause":"16.2.2.2","ids":["prod-eVpymyj4"]}},"prod-xLj2bJln":{"WithClauseToAttributes":{"clause":"16.2.2.3","ids":["prod-1UPpcS0w"]}},"prod-ZnIdxoxz":{"WithClauseToAttributes":{"clause":"16.2.2.3","ids":["prod-gJ_q10-H"]}},"prod-d4roO8vu":{"WithClauseToAttributes":{"clause":"16.2.2.3","ids":["prod-8QmTjvbt"]}},"prod-xjGle5Tn":{"WithClauseToAttributes":{"clause":"16.2.2.3","ids":["prod-8oUbk6ND"]}},"prod-0HE4RviZ":{"WithClauseToAttributes":{"clause":"16.2.2.3","ids":["prod-_N0cbM5m"]}},"prod-oClSJ6kb":{"WithClauseToAttributes":{"clause":"16.2.2.3","ids":["prod-yNAe-CX-"]}}}`);
-let biblio = JSON.parse(`{"refsByClause":{"intro":["_ref_0","_ref_1"],"sec-cyclic-module-records":["_ref_2","_ref_36","_ref_37","_ref_38","_ref_39","_ref_40","_ref_41"],"sec-source-text-module-records":["_ref_3","_ref_42","_ref_43","_ref_44","_ref_45","_ref_82","_ref_83"],"sec-HostLoadImportedModule":["_ref_4","_ref_46","_ref_47","_ref_48","_ref_49","_ref_50","_ref_51","_ref_52"],"sec-import-call-runtime-semantics-evaluation":["_ref_5","_ref_6","_ref_7"],"sec-evaluate-import-call":["_ref_8","_ref_9","_ref_10","_ref_11"],"sec-modulerequest-record":["_ref_12","_ref_13","_ref_14","_ref_15","_ref_16","_ref_17","_ref_18","_ref_19","_ref_20"],"sec-static-semantics-modulerequests":["_ref_21","_ref_22","_ref_23","_ref_24","_ref_25","_ref_26","_ref_27","_ref_28","_ref_29","_ref_30","_ref_31","_ref_32","_ref_33","_ref_34","_ref_35","_ref_78","_ref_79","_ref_80","_ref_81"],"sec-FinishLoadingImportedModule":["_ref_53","_ref_54","_ref_55","_ref_56"],"sec-FinishLoadingImportedModule-AttributesEqual":["_ref_57","_ref_58","_ref_59","_ref_60"],"sec-AllImportAttributesSupported":["_ref_61","_ref_62","_ref_63"],"sec-imports-static-semantics-early-errors":["_ref_64","_ref_65","_ref_66","_ref_91","_ref_92","_ref_93","_ref_94"],"sec-with-clause-to-attributes":["_ref_67","_ref_68","_ref_69","_ref_70","_ref_71","_ref_72","_ref_73","_ref_95","_ref_96","_ref_97","_ref_98","_ref_99","_ref_100","_ref_101","_ref_102","_ref_103"],"sec-host-integration":["_ref_74","_ref_75","_ref_76","_ref_77"],"sec-imports":["_ref_84","_ref_85","_ref_86","_ref_87","_ref_88","_ref_89","_ref_90"],"sec-exports":["_ref_104"]},"entries":[{"type":"clause","id":"intro","titleHTML":"Import Attributes","number":""},{"type":"production","id":"prod-ImportCall","name":"ImportCall"},{"type":"clause","id":"sec-import-call-runtime-semantics-evaluation","titleHTML":"Runtime Semantics: Evaluation","number":"13.3.10.1"},{"type":"op","aoid":"EvaluateImportCall","refId":"sec-evaluate-import-call"},{"type":"clause","id":"sec-evaluate-import-call","title":"EvaluateImportCall ( specifierExpression [ , optionsExpression ] )","titleHTML":"EvaluateImportCall ( specifierExpression [ , optionsExpression ] ) ","number":"13.3.10.2","referencingIds":["_ref_0","_ref_5","_ref_6"]},{"type":"clause","id":"sec-import-calls","titleHTML":"Import Calls","number":"13.3.10","referencingIds":["_ref_4"]},{"type":"clause","id":"sec-left-hand-side-expressions","titleHTML":"Left-Hand-Side Expressions","number":"13.3"},{"type":"clause","id":"sec-ecmascript-language-expressions","titleHTML":"ECMAScript Language: Expressions","number":"13"},{"type":"term","term":"ModuleRequest Record","id":"modulerequest-record","referencingIds":["_ref_10","_ref_12","_ref_15","_ref_17","_ref_18","_ref_20","_ref_21","_ref_25","_ref_26","_ref_29","_ref_31","_ref_33","_ref_35","_ref_40","_ref_44","_ref_45","_ref_47","_ref_54","_ref_75","_ref_76","_ref_77"]},{"type":"table","id":"table-modulerequest-fields","number":1,"caption":"Table 1: ModuleRequest Record fields"},{"type":"term","term":"ImportAttribute Record","id":"importattribute-record","referencingIds":["_ref_8","_ref_13","_ref_14","_ref_41","_ref_57","_ref_58","_ref_59","_ref_60","_ref_61","_ref_63","_ref_67","_ref_70","_ref_72"]},{"type":"table","id":"table-importattribute-fields","number":2,"caption":"Table 2: ImportAttribute Record fields"},{"type":"clause","id":"sec-modulerequest-record","title":"ModuleRequest and ImportAttribute Records","titleHTML":"ModuleRequest and ImportAttribute Records ","number":"16.2.1.1"},{"type":"op","aoid":"ModuleRequests","refId":"sec-static-semantics-modulerequests"},{"type":"clause","id":"sec-static-semantics-modulerequests","titleHTML":"Static Semantics: ModuleRequests","number":"16.2.1.3","referencingIds":["_ref_16","_ref_22","_ref_23","_ref_24","_ref_28","_ref_32"]},{"type":"term","term":"Cyclic Module Record","id":"cyclic-module-record","referencingIds":["_ref_19","_ref_36","_ref_37","_ref_38","_ref_39","_ref_46","_ref_53","_ref_56"]},{"type":"table","id":"table-cyclic-module-fields","number":3,"caption":"Table 3: Additional Fields of Cyclic Module Records","referencingIds":["_ref_2"]},{"type":"clause","id":"sec-cyclic-module-records","titleHTML":"Cyclic Module Records","number":"16.2.1.5"},{"type":"term","term":"ImportEntry Record","id":"importentry-record","referencingIds":["_ref_42","_ref_43"]},{"type":"table","id":"table-importentry-record-fields","number":4,"caption":"Table 4: ImportEntry Record Fields","referencingIds":["_ref_3"]},{"type":"clause","id":"sec-source-text-module-records","titleHTML":"Source Text Module Records","number":"16.2.1.6"},{"type":"note","id":"note-HostLoadImportedModule-referrer-Realm-Record","number":1},{"type":"op","aoid":"HostLoadImportedModule","refId":"sec-HostLoadImportedModule"},{"type":"clause","id":"sec-HostLoadImportedModule","title":"HostLoadImportedModule ( referrer, specifier, moduleRequest, hostDefined, payload )","titleHTML":"HostLoadImportedModule ( referrer , specifier , moduleRequest , hostDefined , payload )","number":"16.2.1.8","referencingIds":["_ref_7","_ref_11","_ref_74"]},{"type":"op","aoid":"AttributesEqual","refId":"sec-FinishLoadingImportedModule-AttributesEqual"},{"type":"clause","id":"sec-FinishLoadingImportedModule-AttributesEqual","title":"AttributesEqual ( left, right )","titleHTML":"AttributesEqual ( left , right ) ","number":"16.2.1.9.1","referencingIds":["_ref_27","_ref_49","_ref_55"]},{"type":"op","aoid":"FinishLoadingImportedModule","refId":"sec-FinishLoadingImportedModule"},{"type":"clause","id":"sec-FinishLoadingImportedModule","title":"FinishLoadingImportedModule ( referrer, specifier, moduleRequest, payload, result )","titleHTML":"FinishLoadingImportedModule ( referrer , specifier , moduleRequest , payload , result )","number":"16.2.1.9","referencingIds":["_ref_48","_ref_50","_ref_51","_ref_52"]},{"type":"op","aoid":"HostGetSupportedImportAttributes","refId":"sec-hostgetsupportedimportattributes"},{"type":"clause","id":"sec-hostgetsupportedimportattributes","title":"HostGetSupportedImportAttributes ( )","titleHTML":"HostGetSupportedImportAttributes ( ) ","number":"16.2.1.10.1","referencingIds":["_ref_62"]},{"type":"op","aoid":"AllImportAttributesSupported","refId":"sec-AllImportAttributesSupported"},{"type":"clause","id":"sec-AllImportAttributesSupported","title":"AllImportAttributesSupported ( attributes )","titleHTML":"AllImportAttributesSupported ( attributes ) ","number":"16.2.1.10","referencingIds":["_ref_9","_ref_65"]},{"type":"clause","id":"sec-module-semantics","titleHTML":"Module Semantics","number":"16.2.1"},{"type":"production","id":"prod-ImportDeclaration","name":"ImportDeclaration","referencingIds":["_ref_82","_ref_83"]},{"type":"production","id":"prod-WithClause","name":"WithClause","referencingIds":["_ref_78","_ref_79","_ref_80","_ref_81","_ref_84","_ref_85","_ref_93","_ref_94","_ref_104"]},{"type":"production","id":"prod-WithEntries","name":"WithEntries","referencingIds":["_ref_86","_ref_87","_ref_90","_ref_91","_ref_92","_ref_95","_ref_96","_ref_97","_ref_101","_ref_103"]},{"type":"production","id":"prod-AttributeKey","name":"AttributeKey","referencingIds":["_ref_88","_ref_89","_ref_98","_ref_99","_ref_100","_ref_102"]},{"type":"clause","id":"sec-imports-static-semantics-early-errors","titleHTML":"Static Semantics: Early Errors","number":"16.2.2.1"},{"type":"op","aoid":"AttributeName","refId":"sec-import-static-semantics-attribute-name"},{"type":"clause","id":"sec-import-static-semantics-attribute-name","title":"Static Semantics: AttributeName","titleHTML":"Static Semantics: AttributeName ","number":"16.2.2.2","referencingIds":["_ref_69","_ref_71"]},{"type":"op","aoid":"WithClauseToAttributes","refId":"sec-with-clause-to-attributes"},{"type":"clause","id":"sec-with-clause-to-attributes","title":"Static Semantics: WithClauseToAttributes","titleHTML":"Static Semantics: WithClauseToAttributes ","number":"16.2.2.3","referencingIds":["_ref_30","_ref_34","_ref_64","_ref_66","_ref_68","_ref_73"]},{"type":"clause","id":"sec-imports","titleHTML":"Imports","number":"16.2.2","referencingIds":["_ref_1"]},{"type":"clause","id":"sec-exports","titleHTML":"Exports","number":"16.2.3"},{"type":"clause","id":"sec-modules","titleHTML":"Modules","number":"16.2"},{"type":"clause","id":"sec-ecmascript-language-scripts-and-modules","titleHTML":"ECMAScript Language: Scripts and Modules","number":"16"},{"type":"clause","id":"sec-host-integration","titleHTML":"Sample host integration: The Web embedding","number":"A"}]}`);
+let sdoMap = JSON.parse(`{"prod-k77_OH1u":{"Evaluation":{"clause":"13.3.10.1","ids":["prod-DuEmEibb","prod-4N8EtSSM"]}},"prod-nQPLRauX":{"Evaluation":{"clause":"13.3.10.1","ids":["prod-OGjeE4Nc"]}},"prod-WzAgO-V_":{"ModuleRequests":{"clause":"16.2.1.3","ids":["prod-Fii3Jv-w"]}},"prod-L0spfeSo":{"ModuleRequests":{"clause":"16.2.1.3","ids":["prod-QB5EyLim"]}},"prod-OoOZVSpA":{"AttributeName":{"clause":"16.2.2.2","ids":["prod-StBELvn0"]}},"prod-CstywuHG":{"AttributeName":{"clause":"16.2.2.2","ids":["prod-eVpymyj4"]}},"prod-xLj2bJln":{"WithClauseToAttributes":{"clause":"16.2.2.3","ids":["prod-1UPpcS0w"]}},"prod-d4roO8vu":{"WithClauseToAttributes":{"clause":"16.2.2.3","ids":["prod-8QmTjvbt"]}},"prod-0HE4RviZ":{"WithClauseToAttributes":{"clause":"16.2.2.3","ids":["prod-_N0cbM5m"]}},"prod-oClSJ6kb":{"WithClauseToAttributes":{"clause":"16.2.2.3","ids":["prod-yNAe-CX-"]}}}`);
+let biblio = JSON.parse(`{"refsByClause":{"intro":["_ref_0"],"sec-evaluate-import-call":["_ref_1","_ref_17","_ref_18","_ref_19","_ref_20","_ref_21","_ref_22"],"sec-cyclic-module-records":["_ref_2","_ref_47","_ref_48","_ref_49","_ref_50","_ref_51","_ref_52"],"sec-source-text-module-records":["_ref_3","_ref_53","_ref_54","_ref_55","_ref_56","_ref_100","_ref_101"],"sec-HostLoadImportedModule":["_ref_4","_ref_57","_ref_58","_ref_59","_ref_60","_ref_61","_ref_62","_ref_63"],"sec-imports":["_ref_5","_ref_102","_ref_103","_ref_104","_ref_105","_ref_106","_ref_107"],"sec-imports-static-semantics-early-errors":["_ref_6","_ref_75","_ref_76","_ref_77","_ref_108","_ref_109","_ref_110"],"sec-with-clause-to-attributes":["_ref_7","_ref_78","_ref_79","_ref_80","_ref_81","_ref_82","_ref_83","_ref_84","_ref_111","_ref_112","_ref_113","_ref_114","_ref_115","_ref_116","_ref_117","_ref_118"],"sec-deprecated-assert-keyword-for-import-attributes":["_ref_8","_ref_9","_ref_10","_ref_11","_ref_12","_ref_85","_ref_86","_ref_87","_ref_88","_ref_89","_ref_90","_ref_91","_ref_119","_ref_120","_ref_121","_ref_122","_ref_123","_ref_124","_ref_125","_ref_126","_ref_127"],"sec-conformance-deprecated":["_ref_13"],"sec-import-call-runtime-semantics-evaluation":["_ref_14","_ref_15","_ref_16"],"sec-modulerequest-record":["_ref_23","_ref_24","_ref_25","_ref_26","_ref_27","_ref_28","_ref_29","_ref_30","_ref_31"],"sec-static-semantics-modulerequests":["_ref_32","_ref_33","_ref_34","_ref_35","_ref_36","_ref_37","_ref_38","_ref_39","_ref_40","_ref_41","_ref_42","_ref_43","_ref_44","_ref_45","_ref_46","_ref_96","_ref_97","_ref_98","_ref_99"],"sec-FinishLoadingImportedModule":["_ref_64","_ref_65","_ref_66","_ref_67"],"sec-FinishLoadingImportedModule-AttributesEqual":["_ref_68","_ref_69","_ref_70","_ref_71"],"sec-AllImportAttributesSupported":["_ref_72","_ref_73","_ref_74"],"sec-host-integration":["_ref_92","_ref_93","_ref_94","_ref_95"],"sec-exports":["_ref_128"]},"entries":[{"type":"clause","id":"intro","titleHTML":"Import Attributes","number":""},{"type":"term","term":"Deprecated","refId":"sec-conformance"},{"type":"clause","id":"sec-conformance-deprecated","titleHTML":"Example Deprecated Clause Heading","number":"2.1"},{"type":"clause","id":"sec-conformance","titleHTML":"Conformance","number":"2","referencingIds":["_ref_0","_ref_13","_ref_17","_ref_18","_ref_90","_ref_91"]},{"type":"production","id":"prod-ImportCall","name":"ImportCall"},{"type":"clause","id":"sec-import-call-runtime-semantics-evaluation","titleHTML":"Runtime Semantics: Evaluation","number":"13.3.10.1"},{"type":"step","id":"step-evaluate-import-call-assert-fallback","referencingIds":["_ref_8"]},{"type":"op","aoid":"EvaluateImportCall","refId":"sec-evaluate-import-call"},{"type":"clause","id":"sec-evaluate-import-call","title":"EvaluateImportCall ( specifierExpression [ , optionsExpression ] )","titleHTML":"EvaluateImportCall ( specifierExpression [ , optionsExpression ] ) ","number":"13.3.10.2","referencingIds":["_ref_9","_ref_14","_ref_15"]},{"type":"clause","id":"sec-import-calls","titleHTML":"Import Calls","number":"13.3.10","referencingIds":["_ref_4"]},{"type":"clause","id":"sec-left-hand-side-expressions","titleHTML":"Left-Hand-Side Expressions","number":"13.3"},{"type":"clause","id":"sec-ecmascript-language-expressions","titleHTML":"ECMAScript Language: Expressions","number":"13"},{"type":"term","term":"ModuleRequest Record","id":"modulerequest-record","referencingIds":["_ref_21","_ref_23","_ref_26","_ref_28","_ref_29","_ref_31","_ref_32","_ref_36","_ref_37","_ref_40","_ref_42","_ref_44","_ref_46","_ref_51","_ref_55","_ref_56","_ref_58","_ref_65","_ref_93","_ref_94","_ref_95"]},{"type":"table","id":"table-modulerequest-fields","number":1,"caption":"Table 1: ModuleRequest Record fields"},{"type":"term","term":"ImportAttribute Record","id":"importattribute-record","referencingIds":["_ref_19","_ref_24","_ref_25","_ref_52","_ref_68","_ref_69","_ref_70","_ref_71","_ref_72","_ref_74","_ref_78","_ref_81","_ref_83"]},{"type":"table","id":"table-importattribute-fields","number":2,"caption":"Table 2: ImportAttribute Record fields"},{"type":"clause","id":"sec-modulerequest-record","title":"ModuleRequest and ImportAttribute Records","titleHTML":"ModuleRequest and ImportAttribute Records ","number":"16.2.1.1"},{"type":"op","aoid":"ModuleRequests","refId":"sec-static-semantics-modulerequests"},{"type":"clause","id":"sec-static-semantics-modulerequests","titleHTML":"Static Semantics: ModuleRequests","number":"16.2.1.3","referencingIds":["_ref_27","_ref_33","_ref_34","_ref_35","_ref_39","_ref_43"]},{"type":"term","term":"Cyclic Module Record","id":"cyclic-module-record","referencingIds":["_ref_30","_ref_47","_ref_48","_ref_49","_ref_50","_ref_57","_ref_64","_ref_67"]},{"type":"table","id":"table-cyclic-module-fields","number":3,"caption":"Table 3: Additional Fields of Cyclic Module Records","referencingIds":["_ref_2"]},{"type":"clause","id":"sec-cyclic-module-records","titleHTML":"Cyclic Module Records","number":"16.2.1.5"},{"type":"term","term":"ImportEntry Record","id":"importentry-record","referencingIds":["_ref_53","_ref_54"]},{"type":"table","id":"table-importentry-record-fields","number":4,"caption":"Table 4: ImportEntry Record Fields","referencingIds":["_ref_3"]},{"type":"clause","id":"sec-source-text-module-records","titleHTML":"Source Text Module Records","number":"16.2.1.6"},{"type":"note","id":"note-HostLoadImportedModule-referrer-Realm-Record","number":1},{"type":"op","aoid":"HostLoadImportedModule","refId":"sec-HostLoadImportedModule"},{"type":"clause","id":"sec-HostLoadImportedModule","title":"HostLoadImportedModule ( referrer, specifier, moduleRequest, hostDefined, payload )","titleHTML":"HostLoadImportedModule ( referrer , specifier , moduleRequest , hostDefined , payload )","number":"16.2.1.8","referencingIds":["_ref_16","_ref_22","_ref_92"]},{"type":"op","aoid":"AttributesEqual","refId":"sec-FinishLoadingImportedModule-AttributesEqual"},{"type":"clause","id":"sec-FinishLoadingImportedModule-AttributesEqual","title":"AttributesEqual ( left, right )","titleHTML":"AttributesEqual ( left , right ) ","number":"16.2.1.9.1","referencingIds":["_ref_38","_ref_60","_ref_66"]},{"type":"op","aoid":"FinishLoadingImportedModule","refId":"sec-FinishLoadingImportedModule"},{"type":"clause","id":"sec-FinishLoadingImportedModule","title":"FinishLoadingImportedModule ( referrer, specifier, moduleRequest, payload, result )","titleHTML":"FinishLoadingImportedModule ( referrer , specifier , moduleRequest , payload , result )","number":"16.2.1.9","referencingIds":["_ref_59","_ref_61","_ref_62","_ref_63"]},{"type":"op","aoid":"HostGetSupportedImportAttributes","refId":"sec-hostgetsupportedimportattributes"},{"type":"clause","id":"sec-hostgetsupportedimportattributes","title":"HostGetSupportedImportAttributes ( )","titleHTML":"HostGetSupportedImportAttributes ( ) ","number":"16.2.1.10.1","referencingIds":["_ref_73"]},{"type":"op","aoid":"AllImportAttributesSupported","refId":"sec-AllImportAttributesSupported"},{"type":"clause","id":"sec-AllImportAttributesSupported","title":"AllImportAttributesSupported ( attributes )","titleHTML":"AllImportAttributesSupported ( attributes ) ","number":"16.2.1.10","referencingIds":["_ref_20","_ref_76","_ref_86"]},{"type":"clause","id":"sec-module-semantics","titleHTML":"Module Semantics","number":"16.2.1"},{"type":"production","id":"prod-ImportDeclaration","name":"ImportDeclaration"},{"type":"production","id":"prod-WithClause","name":"WithClause","referencingIds":["_ref_96","_ref_97","_ref_98","_ref_99","_ref_102","_ref_103","_ref_109","_ref_110","_ref_128"]},{"type":"production","id":"prod-WithEntries","name":"WithEntries","referencingIds":["_ref_104","_ref_107","_ref_108","_ref_111","_ref_112","_ref_116","_ref_118","_ref_122","_ref_123","_ref_126","_ref_127"]},{"type":"production","id":"prod-AttributeKey","name":"AttributeKey","referencingIds":["_ref_105","_ref_106","_ref_113","_ref_114","_ref_115","_ref_117"]},{"type":"clause","id":"sec-imports-static-semantics-early-errors","titleHTML":"Static Semantics: Early Errors","number":"16.2.2.1","referencingIds":["_ref_11"]},{"type":"op","aoid":"AttributeName","refId":"sec-import-static-semantics-attribute-name"},{"type":"clause","id":"sec-import-static-semantics-attribute-name","title":"Static Semantics: AttributeName","titleHTML":"Static Semantics: AttributeName ","number":"16.2.2.2","referencingIds":["_ref_80","_ref_82"]},{"type":"op","aoid":"WithClauseToAttributes","refId":"sec-with-clause-to-attributes"},{"type":"clause","id":"sec-with-clause-to-attributes","title":"Static Semantics: WithClauseToAttributes","titleHTML":"Static Semantics: WithClauseToAttributes ","number":"16.2.2.3","referencingIds":["_ref_12","_ref_41","_ref_45","_ref_75","_ref_77","_ref_79","_ref_84","_ref_85","_ref_87","_ref_88","_ref_89"]},{"type":"production","id":"prod-ImportDeclaration","name":"ImportDeclaration","referencingIds":["_ref_100","_ref_101","_ref_119"]},{"type":"production","id":"prod-AssertClause","name":"AssertClause","referencingIds":["_ref_120","_ref_121","_ref_124","_ref_125"]},{"type":"clause","id":"sec-deprecated-assert-keyword-for-import-attributes","title":"Deprecated assert keyword for Import Attributes","titleHTML":"Deprecated assert
keyword for Import Attributes ","number":"16.2.2.4","referencingIds":["_ref_1","_ref_5","_ref_6","_ref_7"]},{"type":"clause","id":"sec-imports","titleHTML":"Imports","number":"16.2.2","referencingIds":["_ref_10"]},{"type":"clause","id":"sec-exports","titleHTML":"Exports","number":"16.2.3"},{"type":"clause","id":"sec-modules","titleHTML":"Modules","number":"16.2"},{"type":"clause","id":"sec-ecmascript-language-scripts-and-modules","titleHTML":"ECMAScript Language: Scripts and Modules","number":"16"},{"type":"clause","id":"sec-host-integration","titleHTML":"Sample host integration: The Web embedding","number":"A"}]}`);
;let usesMultipage = false
+
Stage 2 Draft / April 13, 2023
Import Attributes
See the explainer for information.
The relevant syntax changes are in the Import Calls and Imports sections.
- This proposal would ideally use the with
keyword to denote attributes, but there are existing implementations based on the previous version of the proposal using the assert
keyword . Due to potential web compatibility risks, the proposal still includes assert
marked as normative optional and legacy in sections 13.3.10.2 and 16.2.2 . Usage of the old syntax is discouraged, and it removal is being investigated.
+ This feature would ideally use the with
keyword to denote attributes, but there are existing implementations based on a previous version of the proposal using the assert
keyword . Due to potential web compatibility risks, the proposal still includes assert
marked as deprecated . Usage of the old syntax is discouraged, and its removal is being investigated.
+
+ 2 Conformance
+
+ 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.
+
+
+ 2.1 Example Deprecated Clause Heading
+ Example clause contents.
+
+
+
13 ECMAScript Language: Expressions
@@ -2704,7 +2691,7 @@ 13.3.10.1 Runtime Semantics: Evaluation
- Return ? EvaluateImportCall (AssignmentExpression ).
+ Return ? EvaluateImportCall (AssignmentExpression ).
ImportCall :
@@ -2718,7 +2705,7 @@ 13.3.10.1 Runtime Semantics: Evaluation
- Return ? EvaluateImportCall (the first AssignmentExpression , the second AssignmentExpression ).
+ Return ? EvaluateImportCall (the first AssignmentExpression , the second AssignmentExpression ).
ImportCall :
@@ -2729,13 +2716,17 @@ 13.3.10.1 Runtime Semantics: Evaluation
- Let referrer be GetActiveScriptOrModule ().If referrer is null , set referrer to the current Realm Record .Let argRef be ? Evaluation of AssignmentExpression .Let specifier be ? GetValue (argRef ).Let promiseCapability be ! NewPromiseCapability (%Promise% ).Let specifierString be Completion (ToString (specifier )).IfAbruptRejectPromise (specifierString , promiseCapability ).Perform HostLoadImportedModule (referrer , specifierString , empty , promiseCapability ).Return promiseCapability .[[Promise]] .
+ Let referrer be GetActiveScriptOrModule ().If referrer is null , set referrer to the current Realm Record .Let argRef be ? Evaluation of AssignmentExpression .Let specifier be ? GetValue (argRef ).Let promiseCapability be ! NewPromiseCapability (%Promise% ).Let specifierString be Completion (ToString (specifier )).IfAbruptRejectPromise (specifierString , promiseCapability ).Perform HostLoadImportedModule (referrer , specifierString , empty , promiseCapability ).Return promiseCapability .[[Promise]] .
13.3.10.2 EvaluateImportCall ( specifierExpression [ , optionsExpression ] )
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:
- Let referrer be GetActiveScriptOrModule (). If referrer is null , set referrer to the current Realm Record . Let specifierRef be the result of evaluating specifierExpression . Let specifier be ? GetValue (specifierRef ). If optionsExpression is present, thenLet optionsRef be the result of evaluating optionsExpression . Let options be ? GetValue (optionsRef ). Else,Let options be undefined . Let promiseCapability be ! NewPromiseCapability (%Promise% ). Let specifierString be Completion (ToString (specifier )). IfAbruptRejectPromise (specifierString , promiseCapability ).Let attributes be a new empty List . If options is not undefined , thenIf Type (options ) is not Object, thenPerform ! Call (promiseCapability .[[Reject]] , undefined , « a newly created TypeError object »). Return promiseCapability .[[Promise]] . Let attributesObj be Completion (Get (options , "with" )). IfAbruptRejectPromise (attributesObj , promiseCapability ).If attributesObj is undefined , thenLet attributesObj be Completion (Get (options , "assert" )). IfAbruptRejectPromise (attributesObj , promiseCapability ). If attributesObj is not undefined , thenIf Type (attributesObj ) is not Object, thenPerform ! Call (promiseCapability .[[Reject]] , undefined , « a newly created TypeError object »). Return promiseCapability .[[Promise]] . Let keys be Completion (EnumerableOwnProperties (attributesObj , key )). IfAbruptRejectPromise (keys , promiseCapability ).For each String key of keys , doLet value be Completion (Get (attributesObj , key )). IfAbruptRejectPromise (value , promiseCapability ).If Type (value ) is not String, thenPerform ! Call (promiseCapability .[[Reject]] , undefined , « a newly created TypeError object »). Return promiseCapability .[[Promise]] . Append the ImportAttribute Record { [[Key]] : key , [[Value]] : value } to attributes . If AllImportAttributesSupported (attributes ) is false , thenPerform ! 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 HostLoadImportedModule (referrer , moduleRequest , empty , promiseCapability ). Return promiseCapability .[[Promise]] .
+ Let referrer be GetActiveScriptOrModule (). If referrer is null , set referrer to the current Realm Record . Let specifierRef be the result of evaluating specifierExpression . Let specifier be ? GetValue (specifierRef ). If optionsExpression is present, thenLet optionsRef be the result of evaluating optionsExpression . Let options be ? GetValue (optionsRef ). Else,Let options be undefined . Let promiseCapability be ! NewPromiseCapability (%Promise% ). Let specifierString be Completion (ToString (specifier )). IfAbruptRejectPromise (specifierString , promiseCapability ).Let attributes be a new empty List . If options is not undefined , thenIf Type (options ) is not Object, thenPerform ! Call (promiseCapability .[[Reject]] , undefined , « a newly created TypeError object »). Return promiseCapability .[[Promise]] . Let attributesObj be Completion (Get (options , "with" )). IfAbruptRejectPromise (attributesObj , promiseCapability ).If the host supports the deprecated assert
keyword for import attributes and attributesObj is undefined , thenLet attributesObj be Completion (Get (options , "assert" )). IfAbruptRejectPromise (attributesObj , promiseCapability ). If attributesObj is not undefined , thenIf Type (attributesObj ) is not Object, thenPerform ! Call (promiseCapability .[[Reject]] , undefined , « a newly created TypeError object »). Return promiseCapability .[[Promise]] . Let keys be Completion (EnumerableOwnProperties (attributesObj , key )). IfAbruptRejectPromise (keys , promiseCapability ).For each String key of keys , doLet value be Completion (Get (attributesObj , key )). IfAbruptRejectPromise (value , promiseCapability ).If Type (value ) is not String, thenPerform ! Call (promiseCapability .[[Reject]] , undefined , « a newly created TypeError object »). Return promiseCapability .[[Promise]] . Append the ImportAttribute Record { [[Key]] : key , [[Value]] : value } to attributes . If AllImportAttributesSupported (attributes ) is false , thenPerform ! 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 HostLoadImportedModule (referrer , moduleRequest , empty , promiseCapability ). Return promiseCapability .[[Promise]] .
+
+ Note
+ Removal of the assert
fallback when options 's with
property is undefined is being investigated.
+
@@ -2754,7 +2745,7 @@
16.2.1 Module Semantics
16.2.1.1 ModuleRequest and ImportAttribute Records
A ModuleRequest Record represents the request to import a module with given import attributes. It consists of the following fields:
-
Table 1: ModuleRequest Record fields
+ Table 1: ModuleRequest Record fields
@@ -2784,7 +2775,7 @@ 16.2.1.1 ModuleRequest and ImportAttribute
[[Attributes]]
- a List of ImportAttribute Records
+ a List of ImportAttribute Records
The import attributes
@@ -2795,7 +2786,7 @@ 16.2.1.1 ModuleRequest and ImportAttribute
An ImportAttribute Record consists of the following fields:
- Table 2: ImportAttribute Record fields
+ Table 2: ImportAttribute Record fields
@@ -2835,12 +2826,12 @@ 16.2.1.1 ModuleRequest and ImportAttribute
- Editor's Note In general, this proposal replaces places where module specifiers are passed around with
ModuleRequest Records . For example, several
syntax-directed operations , such as
ModuleRequests produce
Lists of
ModuleRequest Records rather than
Lists of Strings which are interpreted as module specifiers. Some algorithms like
ImportEntries and
ImportEntriesForModule pass around
ModuleRequest Records rather than Strings, in a way which doesn't require any particular textual change. Additionally, record fields in
Cyclic Module Records and
Source Text Module Records which contained
Lists of Strings are replaced by
Lists of
ModuleRequest Records , as indicated above.
+ Editor's Note In general, this proposal replaces places where module specifiers are passed around with
ModuleRequest Records . For example, several
syntax-directed operations , such as
ModuleRequests produce
Lists of
ModuleRequest Records rather than
Lists of Strings which are interpreted as module specifiers. Some algorithms like
ImportEntries and
ImportEntriesForModule pass around
ModuleRequest Records rather than Strings, in a way which doesn't require any particular textual change. Additionally, record fields in
Cyclic Module Records and
Source Text Module Records which contained
Lists of Strings are replaced by
Lists of
ModuleRequest Records , as indicated above.
16.2.1.3 Static Semantics: ModuleRequests
- The syntax-directed operation ModuleRequests takes no arguments and returns a List of StringsModuleRequest Records . It is defined piecewise over the following productions:
+ The syntax-directed operation ModuleRequests takes no arguments and returns a List of StringsModuleRequest Records . It is defined piecewise over the following productions:
Module : [empty]
@@ -2850,7 +2841,7 @@ 16.2.1.3 Static Semantics: ModuleRequests
ModuleItemList : ModuleItem
- Return ModuleRequests of ModuleItem .
+ Return ModuleRequests of ModuleItem .
ModuleItemList :
ModuleItemList
@@ -2858,7 +2849,7 @@ 16.2.1.3 Static Semantics: ModuleRequests
- Let moduleNames requests be ModuleRequests of ModuleItemList . Let additionalNames additionalRequests be ModuleRequests of ModuleItem . For each String name of additionalNames , doFor each ModuleRequest Record mr of additionalRequests , do If moduleNames requests does not contain name a ModuleRequest Record mr2 such that mr .[[Specifer]] is mr2 .[[Specifer]] and AttributesEqual (mr .[[Attributes]] , mr2 .[[Attributes]] ) is true , thenAppend name mr to moduleNames requests . Return moduleNames requests .
+ Let moduleNames requests be ModuleRequests of ModuleItemList . Let additionalNames additionalRequests be ModuleRequests of ModuleItem . For each String name of additionalNames , doFor each ModuleRequest Record mr of additionalRequests , do If moduleNames requests does not contain name a ModuleRequest Record mr2 such that mr .[[Specifer]] is mr2 .[[Specifer]] and AttributesEqual (mr .[[Attributes]] , mr2 .[[Attributes]] ) is true , thenAppend name mr to moduleNames requests . Return moduleNames requests .
ModuleItem : StatementListItem
@@ -2873,18 +2864,18 @@ 16.2.1.3 Static Semantics: ModuleRequests
- Return ModuleRequests of FromClause .Let specifier be SV of FromClause . Return a List whose sole element is the ModuleRequest Record { [[Specifer]] : specifier , [[Attributes]] : « » }.
+ Return ModuleRequests of FromClause .Let specifier be SV of FromClause . Return a List whose sole element is the ModuleRequest Record { [[Specifer]] : specifier , [[Attributes]] : « » }.
ImportDeclaration :
import
ImportClause
FromClause
- WithClause
+ WithClause
;
- Let specifier be the SV of FromClause . Let attributes be WithClauseToAttributes of WithClause . Return a List whose sole element is the ModuleRequest Record { [[Specifer]] : specifier , [[Attributes]] : attributes }.
+ Let specifier be the SV of FromClause . Let attributes be WithClauseToAttributes of WithClause . Return a List whose sole element is the ModuleRequest Record { [[Specifer]] : specifier , [[Attributes]] : attributes }.
ModuleSpecifier : StringLiteral
@@ -2899,18 +2890,18 @@ 16.2.1.3 Static Semantics: ModuleRequests
- Return ModuleRequests of FromClause .Let specifier be SV of FromClause . Return a List whose sole element is the ModuleRequest Record { [[Specifer]] : specifier , [[Attributes]] : « » }.
+ Return ModuleRequests of FromClause .Let specifier be SV of FromClause . Return a List whose sole element is the ModuleRequest Record { [[Specifer]] : specifier , [[Attributes]] : « » }.
ExportDeclaration :
export
ExportFromClause
FromClause
- WithClause
+ WithClause
;
- Let specifier be SV of FromClause . Let attributes be WithClauseToAttributes of WithClause . Return a List whose sole element is the ModuleRequest Record { [[Specifer]] : specifier , [[Attributes]] : attributes }.
+ Let specifier be SV of FromClause . Let attributes be WithClauseToAttributes of WithClause . Return a List whose sole element is the ModuleRequest Record { [[Specifer]] : specifier , [[Attributes]] : attributes }.
ExportDeclaration :
export
@@ -2948,9 +2939,9 @@ 16.2.1.3 Static Semantics: ModuleRequests
16.2.1.5 Cyclic 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 .
- In addition to the fields defined in Table 40 Cyclic Module Records have the additional fields listed in Table 3
- Table 3: Additional Fields of Cyclic 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 .
+ In addition to the fields defined in Table 40 Cyclic Module Records have the additional fields listed in Table 3
+ Table 3: Additional Fields of Cyclic Module Records
@@ -2996,7 +2987,7 @@ 16.2.1.5 Cyclic Module Records
[[RequestedModules]]
- a List of StringsModuleRequest Records
+ a List of StringsModuleRequest 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.
@@ -3007,7 +2998,7 @@ 16.2.1.5 Cyclic Module Records
[[LoadedModules]]
- a List of Records with fields [[Specifier]] (a String), [[Attributes]] (a List of ImportAttribute Records ) and [[Module]] (a Module Record )
+ a List of Records with fields [[Specifier]] (a String), [[Attributes]] (a List of ImportAttribute Records ) and [[Module]] (a Module Record )
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 .
@@ -3062,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 :
- Table 4: ImportEntry Record Fields
+ An ImportEntry Record is a Record that digests information about a single declarative import. Each ImportEntry Record has the fields defined in Table 4 :
+ Table 4: ImportEntry Record Fields
@@ -3082,11 +3073,11 @@ 16.2.1.6 Source Text Module Records
String
- ModuleRequest Record
+ ModuleRequest Record
- String value of the ModuleSpecifier of the ImportDeclaration .
- ModuleRequest Record representing the ModuleSpecifier and import attributes of the ImportDeclaration .
+ String value of the ModuleSpecifier of the ImportDeclaration .
+ ModuleRequest Record representing the ModuleSpecifier and import attributes of the ImportDeclaration .
@@ -3109,7 +3100,7 @@ 16.2.1.6 Source Text Module Records
16.2.1.8 HostLoadImportedModule ( referrer , specifier , moduleRequest , hostDefined , payload )
- The host-defined abstract operation HostLoadImportedModule takes arguments referrer (a Script Record , a Cyclic Module Record , or a Realm Record ), specifier (a String), moduleRequest (a ModuleRequest Record ) , hostDefined (anything), and payload (a GraphLoadingState Record or a PromiseCapability Record ) and returns unused .
+ The host-defined abstract operation HostLoadImportedModule takes arguments referrer (a Script Record , a Cyclic Module Record , or a Realm Record ), specifier (a String), moduleRequest (a ModuleRequest Record ) , hostDefined (anything), and payload (a GraphLoadingState Record or a PromiseCapability Record ) and returns unused .
Note 1
An example of when referrer can be a Realm Record is in a web browser host . There, if a user clicks on a control given by
@@ -3122,20 +3113,20 @@
16.2.1.8 HostLoadImportedModule ( referrer<
An implementation of HostLoadImportedModule must conform to the following requirements:
- The host environment must perform FinishLoadingImportedModule (referrer , specifier moduleRequest , payload , result ), where result is either a normal completion containing the loaded Module Record or a throw completion , either synchronously or asynchronously.
+ The host environment must perform FinishLoadingImportedModule (referrer , specifier moduleRequest , payload , result ), where result is either a normal completion containing the loaded Module Record or a throw completion , either synchronously or asynchronously.
If this operation is called multiple times with the sametwo (referrer , specifier moduleRequest ) pairs such that:
the first referrer is the same as the second referrer ;
the first moduleRequest .[[Specifier]] is the same as the second moduleRequest .[[Specifier]] ;
- AttributesEqual (the first moduleRequest .[[Attributes]] , the second moduleRequest .[[Attributes]] ) is true ;
- it performs FinishLoadingImportedModule (referrer , specifier moduleRequest , payload , result ) where result is a normal completion ,
+ AttributesEqual (the first moduleRequest .[[Attributes]] , the second moduleRequest .[[Attributes]] ) is true ;
+ it performs FinishLoadingImportedModule (referrer , specifier moduleRequest , payload , result ) where result is a normal completion ,
- then it must perform FinishLoadingImportedModule (referrer , specifier moduleRequest , payload , result ) with the same result each time.
+ then it must perform FinishLoadingImportedModule (referrer , specifier moduleRequest , payload , result ) with the same result each time.
- The operation must treat payload as an opaque value to be passed through to FinishLoadingImportedModule .
+ The operation must treat payload as an opaque value to be passed through to FinishLoadingImportedModule .
@@ -3154,25 +3145,25 @@ 16.2.1.8 HostLoadImportedModule ( referrer<
16.2.1.9 FinishLoadingImportedModule ( referrer , specifier , moduleRequest , payload , result )
- The abstract operation FinishLoadingImportedModule takes arguments referrer (a Script Record , a Cyclic Module Record , or a Realm Record ), specifier (a String), moduleRequest (a ModuleRequest Record ) , payload (a GraphLoadingState Record or a PromiseCapability Record ), and result (either a normal completion containing a Module Record or a throw completion ) and returns unused . It performs the following steps when called:
- If result is a normal completion , thenIf referrer .[[LoadedModules]] contains a Record record such that record .[[Specifier]] is specifier moduleRequest .[[Specifier]] and AttributesEqual (record .[[Attributes]] , moduleRequest .[[Attributes]] ) is true , thenAssert : record .[[Module]] is result .[[Value]] . Else, append the Record { [[Specifier]] : specifier moduleRequest .[[Specifer]] , [[Attributes]] : moduleRequest .[[Attributes]] , [[Module]] : result .[[Value]] } to referrer .[[LoadedModules]] . If payload is a GraphLoadingState Record , thenPerform ContinueModuleLoading (payload , result ). Else,Perform ContinueDynamicImport (payload , result ). Return unused .
+ The abstract operation FinishLoadingImportedModule takes arguments referrer (a Script Record , a Cyclic Module Record , or a Realm Record ), specifier (a String), moduleRequest (a ModuleRequest Record ) , payload (a GraphLoadingState Record or a PromiseCapability Record ), and result (either a normal completion containing a Module Record or a throw completion ) and returns unused . It performs the following steps when called:
+ If result is a normal completion , thenIf referrer .[[LoadedModules]] contains a Record record such that record .[[Specifier]] is specifier moduleRequest .[[Specifier]] and AttributesEqual (record .[[Attributes]] , moduleRequest .[[Attributes]] ) is true , thenAssert : record .[[Module]] is result .[[Value]] . Else, append the Record { [[Specifier]] : specifier moduleRequest .[[Specifer]] , [[Attributes]] : moduleRequest .[[Attributes]] , [[Module]] : result .[[Value]] } to referrer .[[LoadedModules]] . If payload is a GraphLoadingState Record , thenPerform ContinueModuleLoading (payload , result ). Else,Perform ContinueDynamicImport (payload , result ). Return unused .
Editor's Note
-
The description of the [[LoadedModules]] field of Realm Record , Script Record , and Cyclic Module Record should be updated to include the [[Attributes]] field.
+
The description of the [[LoadedModules]] field of Realm Record , Script Record , and Cyclic Module Record should be updated to include the [[Attributes]] field.
16.2.1.9.1 AttributesEqual ( left , right )
- The abstract operation AttributesEqual takes arguments left (a List of ImportAttribute Records ) and right (a List of ImportAttribute Records ) and returns a Boolean. It performs the following steps when called:
+ The abstract operation AttributesEqual takes arguments left (a List of ImportAttribute Records ) and right (a List of ImportAttribute Records ) and returns a Boolean. It performs the following steps when called:
- If the number of elements in left is not the same as the number of elements in right , return false . For each ImportAttribute Record r of left , doLet found be false . For each ImportAttribute Record s of right , doIf r .[[Key]] is s .[[Key]] , thenIf r .[[Value]] is s .[[Value]] , thenSet found to true . Else,Return false . If found is false , return false . Return true .
+ If the number of elements in left is not the same as the number of elements in right , return false . For each ImportAttribute Record r of left , doLet found be false . For each ImportAttribute Record s of right , doIf r .[[Key]] is s .[[Key]] , thenIf r .[[Value]] is s .[[Value]] , thenSet found to true . Else,Return false . If found is false , return false . Return true .
16.2.1.10 AllImportAttributesSupported ( attributes )
- The abstract operation AllImportAttributesSupported takes argument attributes (a List of ImportAttribute Records ) and returns a Boolean. It performs the following steps when called:
- Let supported be HostGetSupportedImportAttributes (). For each ImportAttribute Record attribute of attributes , doIf 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:
+ Let supported be HostGetSupportedImportAttributes (). For each ImportAttribute Record attribute of attributes , doIf supported does not contain attribute .[[Key]] , return false . Return true .
16.2.1.10.1 HostGetSupportedImportAttributes ( )
@@ -3198,7 +3189,7 @@ 16.2.1.10.1 HostGetSupportedImportAttribute
16.2.2 Imports
-
+
ImportDeclaration :
import
ImportClause
@@ -3215,14 +3206,14 @@ 16.2.2 Imports
ImportClause
FromClause
[no LineTerminator here]
- WithClause
+ WithClause
;
import
ModuleSpecifier
[no LineTerminator here]
- WithClause
+ WithClause
;
@@ -3235,35 +3226,23 @@ 16.2.2 Imports
with
{
- WithEntries
+ WithEntries
,opt
}
-
- assert
- {
- }
-
-
- assert
- {
- WithEntries
- ,opt
- }
-
-
+
WithEntries :
- AttributeKey
+ AttributeKey
:
StringLiteral
- AttributeKey
+ AttributeKey
:
StringLiteral
,
- WithEntries
+ WithEntries
@@ -3273,33 +3252,34 @@ 16.2.2 Imports
StringLiteral
-
+
+ Note
+
This section is extended by 16.2.2.4 .
+
+
16.2.2.1 Static Semantics: Early Errors
-
+
WithClause :
with
{
- WithEntries
- ,opt
- }
-
-
- assert
- {
- WithEntries
+ WithEntries
,opt
}
+
+ Note
+
This section is extended by 16.2.2.4 .
+
@@ -3321,63 +3301,136 @@ 16.2.2.2 Static Semantics: AttributeName
16.2.2.3 Static Semantics: WithClauseToAttributes
- The syntax-directed operation WithClauseToAttributes takes no arguments and returns a List of ImportAttribute Records . It is defined piecewise over the following productions:
+ The syntax-directed operation WithClauseToAttributes takes no arguments and returns a List of ImportAttribute Records . It is defined piecewise over the following productions:
-
+
WithClause :
with
{
}
-
- assert
- {
- }
-
Return a new empty List .
-
+
WithClause :
with
{
- WithEntries
- ,opt
- }
-
-
- assert
- {
- WithEntries
+ WithEntries
,opt
}
- Let attributes be WithClauseToAttributes of WithEntries . 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. Return attributes .
+ Let attributes be WithClauseToAttributes of WithEntries . 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. Return attributes .
WithEntries :
- AttributeKey
+ AttributeKey
:
StringLiteral
- Let key be the AttributeName of AttributeKey . Let entry be the ImportAttribute Record { [[Key]] : key , [[Value]] : SV of StringLiteral }. Return « entry ».
+ Let key be the AttributeName of AttributeKey . Let entry be the ImportAttribute Record { [[Key]] : key , [[Value]] : SV of StringLiteral }. Return « entry ».
WithEntries :
- AttributeKey
+ AttributeKey
:
StringLiteral
,
- WithEntries
+ WithEntries
+
+
+
+ Let key be the AttributeName of AttributeKey . Let entry be the ImportAttribute Record { [[Key]] : key , [[Value]] : SV of StringLiteral }. Let rest be WithClauseToAttributes of WithEntries . Return the list-concatenation of « entry » and rest .
+
+ Note
+
This section is extended by 16.2.2.4 .
+
+
+
+
+ 16.2.2.4 Deprecated assert
keyword for Import Attributes
+
+ Import Attributes are denoted using the with
keyword . However, there are existing implementations based on a previous version of the proposal using the assert
keyword . Due to potential web compatibility risks, the assert
keyword 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 ).
+
+ The following augments the ImportDeclaration production in 16.2.2 :
+
+ ImportDeclaration :
+ import
+ ImportClause
+ FromClause
+ [no LineTerminator here]
+ AssertClause
+ ;
+
+
+ import
+ ModuleSpecifier
+ [no LineTerminator here]
+ AssertClause
+ ;
+
+
+
+ AssertClause :
+ assert
+ {
+ }
+
+
+ assert
+ {
+ WithEntries
+ ,opt
+ }
+
+
+
+
+ The static semantics of Early Errors in 16.2.2.1 are augmented with the following:
+
+ AssertClause :
+ assert
+ {
+ WithEntries
+ ,opt
+ }
+
+
+
+
+
+ The static semantics of WithClauseToAttributes in 16.2.2.3 are augmented to include the following:
+
+ AssertClause :
+ assert
+ {
+ }
+
+
+
+ Return a new empty List .
+
+
+ AssertClause :
+ assert
+ {
+ WithEntries
+ ,opt
+ }
- Let key be the AttributeName of AttributeKey . Let entry be the ImportAttribute Record { [[Key]] : key , [[Value]] : SV of StringLiteral }. Let rest be WithClauseToAttributes of WithEntries . Return the list-concatenation of « entry » and rest .
+ Let attributes be WithClauseToAttributes of WithEntries . 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. Return attributes .
@@ -3396,7 +3449,7 @@ 16.2.3 Exports
ExportFromClause
FromClause
[no LineTerminator here]
- WithClause
+ WithClause
;
@@ -3446,8 +3499,8 @@ A Sample host integration: The Web embedding
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.
diff --git a/package.json b/package.json
index ad55175..e2e748e 100644
--- a/package.json
+++ b/package.json
@@ -7,6 +7,6 @@
},
"devDependencies": {
"@tc39/ecma262-biblio": "2.1.2517",
- "ecmarkup": "^16.1.1"
+ "ecmarkup": "^16.2.0"
}
}
diff --git a/spec.emu b/spec.emu
index bc2d0d4..3c42ceb 100644
--- a/spec.emu
+++ b/spec.emu
@@ -12,43 +12,25 @@
contributors: Sven Sauleau, Myles Borins, Daniel Ehrenberg, Daniel Clark, Nicolò Ribaudo
-
-
-
Import Attributes
See the explainer for information.
The relevant syntax changes are in the Import Calls and Imports sections.
- This proposal would ideally use the `with` keyword to denote attributes, but there are existing implementations based on the previous version of the proposal using the `assert` keyword. Due to potential web compatibility risks, the proposal still includes `assert` marked as normative optional and legacy in sections and . Usage of the old syntax is discouraged, and it removal is being investigated.
+ This feature would ideally use the `with` keyword to denote attributes, but there are existing implementations based on a previous version of the proposal using the `assert` keyword. Due to potential web compatibility risks, the proposal still includes `assert` marked as deprecated . Usage of the old syntax is discouraged, and its removal is being investigated.
+
+ Conformance
+
+ 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.
+
+
+ Example Deprecated Clause Heading
+ Example clause contents.
+
+
+
ECMAScript Language: Expressions
@@ -121,7 +103,7 @@
1. Return _promiseCapability_.[[Promise]].
1. Let _attributesObj_ be Completion(Get(_options_, *"with"*)).
1. IfAbruptRejectPromise(_attributesObj_, _promiseCapability_).
- 1. [normative-optional-legacy=""] If _attributesObj_ is *undefined*, then
+ 1. [id="step-evaluate-import-call-assert-fallback", deprecated="", normative-optional=""] If the host supports the deprecated `assert` keyword for import attributes and _attributesObj_ is *undefined*, then
1. Let _attributesObj_ be Completion(Get(_options_, *"assert"*)).
1. IfAbruptRejectPromise(_attributesObj_, _promiseCapability_).
1. If _attributesObj_ is not *undefined*, then
@@ -145,6 +127,10 @@
1. Perform HostLoadImportedModule(_referrer_, _moduleRequest_, ~empty~, _promiseCapability_).
1. Return _promiseCapability_.[[Promise]].
+
+
+ Removal of the `assert` fallback when _options_'s `with` property is *undefined* is being investigated.
+
@@ -663,10 +649,6 @@
WithClause :
`with` `{` `}`
`with` `{` WithEntries `,`? `}`
-
- `assert` `{` `}`
- `assert` `{` WithEntries `,`? `}`
-
WithEntries :
AttributeKey `:` StringLiteral
@@ -678,20 +660,26 @@
+
+ This section is extended by .
+
+
Static Semantics: Early Errors
- WithClause :
- `with` `{` WithEntries `,`? `}`
- `assert` `{` WithEntries `,`? `}`
+ WithClause : `with` `{` WithEntries `,`? `}`
It is a Syntax Error if WithClauseToAttributes of |WithClause| has two entries _a_ and _b_ such that _a_.[[Key]] is _b_.[[Key]].
It is a Syntax Error if AllImportAttributesSupported(WithClauseToAttributes of |WithClause|) is *false*.
+
+
+ This section is extended by .
+
@@ -730,18 +718,14 @@
- WithClause :
- `with` `{` `}`
- `assert` `{` `}`
+ WithClause : `with` `{` `}`
1. Return a new empty List.
- WithClause :
- `with` `{` WithEntries `,`? `}`
- `assert` `{` WithEntries `,`? `}`
+ WithClause : `with` `{` WithEntries `,`? `}`
1. Let _attributes_ be WithClauseToAttributes of |WithEntries|.
@@ -763,6 +747,55 @@
1. Let _rest_ be WithClauseToAttributes of |WithEntries|.
1. Return the list-concatenation of « _entry_ » and _rest_.
+
+
+ This section is extended by .
+
+
+
+
+ Deprecated `assert` keyword for Import Attributes
+
+ Import Attributes are denoted using the `with` keyword. However, there are existing implementations based on a previous version of the proposal using the `assert` keyword. Due to potential web compatibility risks, the `assert` keyword 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 of ).
+
+ The following augments the |ImportDeclaration| production in :
+
+ ImportDeclaration :
+ `import` ImportClause FromClause [no LineTerminator here] AssertClause `;`
+ `import` ModuleSpecifier [no LineTerminator here] AssertClause `;`
+
+ AssertClause :
+ `assert` `{` `}`
+ `assert` `{` WithEntries `,`? `}`
+
+
+ The static semantics of Early Errors in are augmented with the following:
+
+ AssertClause : `assert` `{` WithEntries `,`? `}`
+
+
+ It is a Syntax Error if WithClauseToAttributes of |AssertClause| has two entries _a_ and _b_ such that _a_.[[Key]] is _b_.[[Key]].
+ It is a Syntax Error if AllImportAttributesSupported(WithClauseToAttributes of |AssertClause|) is *false*.
+
+
+ The static semantics of WithClauseToAttributes in are augmented to include the following:
+
+ AssertClause : `assert` `{` `}`
+
+
+ 1. Return a new empty List.
+
+
+
+ AssertClause : `assert` `{` WithEntries `,`? `}`
+
+
+ 1. Let _attributes_ be WithClauseToAttributes of |WithEntries|.
+ 1. 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.
+ 1. Return _attributes_.
+