@@ -2926,7 +2926,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
2926
2926
<li>The <dfn data-x="js-HostEnqueuePromiseJob" data-x-href="https://tc39.es/ecma262/#sec-hostenqueuepromisejob">HostEnqueuePromiseJob</dfn> abstract operation</li>
2927
2927
<li>The <dfn data-x="js-HostEnsureCanAddPrivateElement" data-x-href="https://tc39.es/ecma262/#sec-hostensurecanaddprivateelement">HostEnsureCanAddPrivateElement</dfn> abstract operation</li>
2928
2928
<li>The <dfn data-x="js-HostEnsureCanCompileStrings" data-x-href="https://tc39.es/ecma262/#sec-hostensurecancompilestrings">HostEnsureCanCompileStrings</dfn> abstract operation</li>
2929
- <li>The <dfn data-x="js-HostLoadImportedModule" data-x-href="https://tc39.es/ecma262 /#sec-HostLoadImportedModule">HostLoadImportedModule</dfn> abstract operation</li>
2929
+ <li>The <dfn data-x="js-HostLoadImportedModule" data-x-href="https://tc39.es/proposal-import-attributes /#sec-HostLoadImportedModule">HostLoadImportedModule</dfn> abstract operation</li>
2930
2930
<li>The <dfn data-x="js-HostMakeJobCallback" data-x-href="https://tc39.es/ecma262/#sec-hostmakejobcallback">HostMakeJobCallback</dfn> abstract operation</li>
2931
2931
<li>The <dfn data-x="js-HostPromiseRejectionTracker" data-x-href="https://tc39.es/ecma262/#sec-host-promise-rejection-tracker">HostPromiseRejectionTracker</dfn> abstract operation</li>
2932
2932
<li>The <dfn data-x="js-InitializeHostDefinedRealm" data-x-href="https://tc39.es/ecma262/#sec-initializehostdefinedrealm">InitializeHostDefinedRealm</dfn> abstract operation</li>
@@ -2989,13 +2989,13 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
2989
2989
<p>Users agents that support JavaScript must also implement <cite>ECMAScript
2990
2990
Internationalization API</cite>. <ref spec=JSINTL></p>
2991
2991
2992
- <p>User agents that support JavaScript must also implement the <cite>Import Assertions </cite>
2992
+ <p>User agents that support JavaScript must also implement the <cite>Import Attributes </cite>
2993
2993
proposal. The following terms are defined there, and used in this specification: <ref
2994
- spec=JSIMPORTASSERTIONS ></p>
2994
+ spec=JSIMPORTATTRIBUTES ></p>
2995
2995
2996
2996
<ul class="brief">
2997
- <li>The <dfn data-x-href="https://tc39.es/proposal-import-assertions /#sec-modulerequest-record">ModuleRequest Record</dfn> specification type</li>
2998
- <li>The <dfn data-x="js-HostGetSupportedImportAssertions " data-x-href="https://tc39.es/proposal-import-assertions /#sec-hostgetsupportedimportassertions">HostGetSupportedImportAssertions </dfn> abstract operation</li>
2997
+ <li>The <dfn data-x-href="https://tc39.es/proposal-import-attributes /#sec-modulerequest-record">ModuleRequest Record</dfn> specification type</li>
2998
+ <li>The <dfn data-x="js-HostGetSupportedImportAttributes " data-x-href="https://tc39.es/proposal-import-attributes /#sec-hostgetsupportedimportattributes">HostGetSupportedImportAttributes </dfn> abstract operation</li>
2999
2999
</ul>
3000
3000
3001
3001
<p>User agents that support JavaScript must also implement the <cite>JSON modules</cite>
@@ -60851,7 +60851,7 @@ o............A....e
60851
60851
a <span>JavaScript module script</span>:</p>
60852
60852
60853
60853
<pre><code class="html" data-x=""><script type="module">
60854
- import peopleInSpace from "http://api.open-notify.org/astros.json" assert { type: "json" };
60854
+ import peopleInSpace from "http://api.open-notify.org/astros.json" with { type: "json" };
60855
60855
60856
60856
const list = document.querySelector("#people-in-space");
60857
60857
for (const { craft, name } of peopleInSpace.people) {
@@ -60864,7 +60864,7 @@ o............A....e
60864
60864
<p>MIME type checking for module scripts is strict. In order for the fetch of the <span>JSON
60865
60865
module script</span> to succeed, the HTTP response must have a <span>JSON MIME type</span>, for
60866
60866
example <code data-x="">Content-Type: text/json</code>. On the other hand, if the <code
60867
- data-x="">assert { type: "json" }</code> part of the statement is omitted, it is assumed that the
60867
+ data-x="">with { type: "json" }</code> part of the statement is omitted, it is assumed that the
60868
60868
intent is to import a <span>JavaScript module script</span>, and the fetch will fail if the HTTP
60869
60869
response has a MIME type that is not a <span>JavaScript MIME type</span>.</p>
60870
60870
</div>
@@ -98594,7 +98594,7 @@ document.querySelector("button").addEventListener("click", bound);
98594
98594
<li><p><span>Assert</span>: the result of running the <span>module type allowed</span> steps given
98595
98595
<var>moduleType</var> and <var>module map settings object</var> is true. Otherwise we would not
98596
98596
have reached this point because a failure would have been raised when inspecting
98597
- <var>moduleRequest</var>.[[Assertions ]] in <a href="#validate-requested-module-specifiers">create
98597
+ <var>moduleRequest</var>.[[Attributes ]] in <a href="#validate-requested-module-specifiers">create
98598
98598
a JavaScript module script</a> or <span>fetch a single imported module script</span>.</p></li>
98599
98599
98600
98600
<li><p>Let <var>moduleMap</var> be <var>module map settings object</var>'s <span
@@ -98715,10 +98715,10 @@ document.querySelector("button").addEventListener("click", bound);
98715
98715
<span>module script</span> (on success).</p>
98716
98716
98717
98717
<ol>
98718
- <li><p><span>Assert</span>: <var>moduleRequest</var>.[[Assertions ]] does not contain any <span>Record</span>
98718
+ <li><p><span>Assert</span>: <var>moduleRequest</var>.[[Attributes ]] does not contain any <span>Record</span>
98719
98719
<var>entry</var> such that <var>entry</var>.[[Key]] is not "<code data-x="">type</code>", because
98720
- we only asked for "<code data-x="">type</code>" assertions in
98721
- <span>HostGetSupportedImportAssertions </span>.</p></li>
98720
+ we only asked for "<code data-x="">type</code>" attributes in
98721
+ <span>HostGetSupportedImportAttributes </span>.</p></li>
98722
98722
98723
98723
<li><p>Let <var>moduleType</var> be the result of running the <span>module type from module
98724
98724
request</span> steps given <var>moduleRequest</var>.</p></li>
@@ -98840,10 +98840,10 @@ document.querySelector("button").addEventListener("click", bound);
98840
98840
</ol>
98841
98841
</li>
98842
98842
98843
- <li><p><span>Assert</span>: <var>requested</var>.[[Assertions ]] does not contain any
98843
+ <li><p><span>Assert</span>: <var>requested</var>.[[Attributes ]] does not contain any
98844
98844
<span>Record</span> <var>entry</var> such that <var>entry</var>.[[Key]] is not "<code
98845
- data-x="">type</code>", because we only asked for "<code data-x="">type</code>" assertions in
98846
- <span>HostGetSupportedImportAssertions </span>.</p></li>
98845
+ data-x="">type</code>", because we only asked for "<code data-x="">type</code>" attributes in
98846
+ <span>HostGetSupportedImportAttributes </span>.</p></li>
98847
98847
98848
98848
<li id="validate-requested-module-specifiers">
98849
98849
<p><span data-x="list iterate">For each</span> <span>ModuleRequest record</span>
@@ -98884,8 +98884,8 @@ document.querySelector("button").addEventListener("click", bound);
98884
98884
</ol>
98885
98885
98886
98886
<p class="note">This step is essentially validating all of the requested module specifiers and
98887
- type assertions . We treat a module with unresolvable module specifiers or unsupported type
98888
- assertions the same as one that cannot be parsed; in both cases, a syntactic issue makes it
98887
+ type attributes . We treat a module with unresolvable module specifiers or unsupported type
98888
+ attributes the same as one that cannot be parsed; in both cases, a syntactic issue makes it
98889
98889
impossible to ever contemplate linking the module later.</p>
98890
98890
</li>
98891
98891
@@ -98970,7 +98970,7 @@ document.querySelector("button").addEventListener("click", bound);
98970
98970
<li><p>Let <var>moduleType</var> be "<code data-x="">javascript</code>".</p></li>
98971
98971
98972
98972
<li>
98973
- <p>If <var>moduleRequest</var>.[[Assertions ]] has a <span>Record</span> <var>entry</var> such
98973
+ <p>If <var>moduleRequest</var>.[[Attributes ]] has a <span>Record</span> <var>entry</var> such
98974
98974
that <var>entry</var>.[[Key]] is "<code data-x="">type</code>", then:</p>
98975
98975
98976
98976
<ol>
@@ -98981,7 +98981,7 @@ document.querySelector("button").addEventListener("click", bound);
98981
98981
<p class="note">This specification uses the "<code data-x="">javascript</code>" module type
98982
98982
internally for <span data-x="JavaScript module script">JavaScript module scripts</span>, so
98983
98983
this step is needed to prevent modules from being imported using a "<code
98984
- data-x="">javascript</code>" type assertion (a null <var>moduleType</var> will cause the
98984
+ data-x="">javascript</code>" type attribute (a null <var>moduleType</var> will cause the
98985
98985
<span>module type allowed</span> check to fail).</p>
98986
98986
</li>
98987
98987
@@ -100740,15 +100740,10 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
100740
100740
import "https://example.com/module";
100741
100741
</script>
100742
100742
<script type=module>
100743
- import "https://example.com/module" assert { type: "css" };
100743
+ import "https://example.com/module" with { type: "css" };
100744
100744
</script></code></pre>
100745
100745
100746
- <p>This can result in two separate fetches and two separate module evaluations being performed.
100747
- This is a <span>willful violation</span> of a constraint recommended (but not required) by the
100748
- import assertions specification stating that each call to <span>HostLoadImportedModule</span>
100749
- with the same (<var>referrer</var>, <var>moduleRequest</var>.[[Specifier]]) pair
100750
- must return the same <span data-x="Source Text Module Record">Module Record</span>. <ref
100751
- spec=JSIMPORTASSERTIONS></p>
100746
+ <p>This can result in two separate fetches and two separate module evaluations being performed.</p>
100752
100747
100753
100748
<p class="XXX">In practice, due to the as-yet-unspecified memory cache (see issue <a
100754
100749
href="https://github.com/whatwg/html/issues/6110">#6110</a>) the resource may only be fetched
@@ -100757,26 +100752,26 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
100757
100752
least one of the imports, so at most one module evaluation will occur.</p>
100758
100753
100759
100754
<p>The purpose of including the type in the <span>module map</span> key is so that an import
100760
- with the wrong type assertion does not prevent a different import of the same specifier but with
100755
+ with the wrong type attribute does not prevent a different import of the same specifier but with
100761
100756
the correct type from succeeding.</p>
100762
100757
</div>
100763
100758
100764
100759
<div class="example">
100765
100760
<p>JavaScript module scripts are the default import type when importing from another JavaScript
100766
100761
module; that is, when an <code data-x="">import</code> statement lacks a <code
100767
- data-x="">type</code> import assertion the imported module script's type will be JavaScript.
100762
+ data-x="">type</code> import attribute the imported module script's type will be JavaScript.
100768
100763
Attempting to import a JavaScript resource using an <code data-x="">import</code> statement with
100769
- a <code data-x="">type</code> import assertion will fail:</p>
100764
+ a <code data-x="">type</code> import attribute will fail:</p>
100770
100765
100771
100766
<pre><code class="html"><script type="module">
100772
100767
// All of the following will fail, assuming that the imported .mjs files are served with a
100773
100768
// JavaScript MIME type. JavaScript module scripts are the default and cannot be imported with
100774
- // any import type assertion .
100775
- import foo from "./foo.mjs" assert { type: "javascript" };
100776
- import foo2 from "./foo2.mjs" assert { type: "js" };
100777
- import foo3 from "./foo3.mjs" assert { type: "" };
100778
- await import("./foo4.mjs", { assert : { type: null } });
100779
- await import("./foo5.mjs", { assert : { type: undefined } });
100769
+ // any import type attribute .
100770
+ import foo from "./foo.mjs" with { type: "javascript" };
100771
+ import foo2 from "./foo2.mjs" with { type: "js" };
100772
+ import foo3 from "./foo3.mjs" with { type: "" };
100773
+ await import("./foo4.mjs", { with : { type: null } });
100774
+ await import("./foo5.mjs", { with : { type: undefined } });
100780
100775
</script></code></pre>
100781
100776
</div>
100782
100777
@@ -100824,12 +100819,12 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
100824
100819
».</p></li>
100825
100820
</ol>
100826
100821
100827
- <h6 id="hostgetsupportedimportassertions"><dfn>HostGetSupportedImportAssertions </dfn>()</h6>
100822
+ <h6 id="hostgetsupportedimportattributes"><span id=" hostgetsupportedimportassertions"></span>< dfn>HostGetSupportedImportAttributes </dfn>()</h6>
100828
100823
100829
- <p>The <cite>Import Assertions </cite> proposal contains an <span>implementation-defined</span>
100830
- <span data-x="js-HostGetSupportedImportAssertions">HostGetSupportedImportAssertions </span>
100824
+ <p>The <cite>Import Attributes </cite> proposal contains an <span>implementation-defined</span>
100825
+ <span data-x="js-HostGetSupportedImportAttributes">HostGetSupportedImportAttributes </span>
100831
100826
abstract operation. User agents must use the following implementation: <ref
100832
- spec=JSIMPORTASSERTIONS ></p>
100827
+ spec=JSIMPORTATTRIBUTES ></p>
100833
100828
100834
100829
<ol>
100835
100830
<li><p>Return « "<code data-x="">type</code>" ».</p></li>
@@ -100842,12 +100837,6 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
100842
100837
data-x="js-HostLoadImportedModule">HostLoadImportedModule</span> abstract operation. User agents
100843
100838
must use the following implementation: <ref spec=JAVASCRIPT></p>
100844
100839
100845
- <p class="note">This specification expects the second parameter to be a <span>ModuleRequest
100846
- Record</span>, instead of a string as specified by ECMA-262. This is under the assumption that the
100847
- <cite>import assertions</cite> proposal, when updated to use <span>HostLoadImportedModule</span>
100848
- instead of the previous module loading hooks, will update the abstract operation passing a
100849
- <span>ModuleRequest Record</span>. <ref spec=JSIMPORTASSERTIONS></p>
100850
-
100851
100840
<ol>
100852
100841
<li><p>Let <var>settingsObject</var> be the <span>current settings object</span>.</p></li>
100853
100842
@@ -133360,8 +133349,8 @@ INSERT INTERFACES HERE
133360
133349
<dt id="refsJSERRORSTACKS">[JSERRORSTACKS]</dt>
133361
133350
<dd>(Non-normative) <cite><a href="https://tc39.es/proposal-error-stacks/">Error Stacks</a></cite>. Ecma International.</dd>
133362
133351
133363
- <dt id="refsJSIMPORTASSERTIONS ">[JSIMPORTASSERTIONS ]</dt>
133364
- <dd><cite><a href="https://tc39.es/proposal-import-assertions /">Import Assertions </a></cite>. Ecma International.</dd>
133352
+ <dt id="refsJSIMPORTATTRIBUTES ">[JSIMPORTATTRIBUTES ]</dt>
133353
+ <dd><cite><a href="https://tc39.es/proposal-import-attributes /">Import attributes </a></cite>. Ecma International.</dd>
133365
133354
133366
133355
<dt id="refsJSJSONMODULES">[JSJSONMODULES]</dt>
133367
133356
<dd><cite><a href="https://tc39.es/proposal-json-modules/">JSON Modules</a></cite>. Ecma International.</dd>
0 commit comments