Skip to content

Commit e38d922

Browse files
committed
Address Shu's stage 3 review feedback
1 parent ffda9ac commit e38d922

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

spec.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ <h1>Runtime Semantics: Evaluation</h1>
9797
1. <ins>For each String _key_ of _keys_,</ins>
9898
1. <ins>Let _value_ be Get(_assertionsObj_, _key_).</ins>
9999
1. <ins>IfAbruptRejectPromise(_value_, _promiseCapability_).</ins>
100-
1. <ins>Append { [[Key]]: _key_, [[Value]], _value_ } to _assertions_.</ins>
100+
1. <ins>Append { [[Key]]: _key_, [[Value]]: _value_ } to _assertions_.</ins>
101101
1. <ins>Sort _assertions_ by the code point order of the [[Key]] of each entry. NOTE: This sorting is observable only in that hosts are prohibited from distinguishing among assertions by the order they occur in.</ens>
102102
1. <ins>Let _moduleRequest_ be a new ModuleRequest Record { [[Specifier]]: _specifierString_, [[Assertions]]: _assertions_ }.</ins>
103103
1. Perform ! HostImportModuleDynamically(_referencingScriptOrModule_, <del>_specifierString_,</del> <ins>_moduleRequest_,</ins> _promiseCapability_).
@@ -224,7 +224,7 @@ <h1>Static Semantics: Early Errors</h1>
224224
</emu-clause>
225225

226226
<emu-clause id="sec-assert-clause-to-assertions" aoid="AssertClauseToAssertions">
227-
<h1>Runtime Semantics: AssertClauseToAssertions</h1>
227+
<h1>Static Semantics: AssertClauseToAssertions</h1>
228228
<emu-grammar>AssertClause : `assert` `{` `}`</emu-grammar>
229229
<emu-alg>
230230
1. Return a new empty List.
@@ -245,11 +245,14 @@ <h1>Runtime Semantics: AssertClauseToAssertions</h1>
245245

246246
<emu-grammar> AssertEntries : AssertionKey `:` StringLiteral `,` AssertEntries </emu-grammar>
247247
<emu-alg>
248-
1. Let _entry_ be a Record { [[Key]]: AssertClauseToAssertions of |AssertionKey|, [[Value]]: StringValue of |StringLiteral| }.
248+
1. Let _entry_ be a Record { [[Key]]: StringValue of |AssertionKey|, [[Value]]: StringValue of |StringLiteral| }.
249249
1. Let _rest_ be AssertClauseToAssertions of |AssertEntries|.
250250
1. Return a new List containing _entry_ followed by the entries of _rest_.
251251
</emu-alg>
252+
</emu-clause>
252253

254+
<emu-clause id="sec-assertion-key-string-value">
255+
<h1>Static Semantics: StringValue</h1>
253256
<emu-grammar> AssertionKey : IdentifierName </emu-grammar>
254257
<emu-alg>
255258
1. Return the StringValue of |IdentifierName|.
@@ -515,11 +518,11 @@ <h1>Sample host integration: The Web embedding</h1>
515518
<li>In the <a href="https://html.spec.whatwg.org/#fetch-the-descendants-of-a-module-script">fetch the descendents of a module script</a> 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 assertion.</li>
516519
<li>"Fetch a single module script" would check the assertion in two places:
517520
<ul>
518-
<li>If the module is found in the module map, then _type_ is checked against the module script's type field. If they differ, then an exception is thrown and module loading fails.</li>
521+
<li>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.</li>
519522
<li>When a new module is fetched, before writing it into the module map, the MIME type is checked to ensure that it matches _type_. (Note that the interpretation of the module is still driven by the MIME type, but once the MIME type is established, this is checked against the _type_.) If they differ, then an exception is thrown and module loading fails. The _type_ is written into the module script as the type.</li>
520523
</ul>
521524
</li>
522525
</ul>
523526

524-
<p>Note that the module map remains keyed by the absolute URL; the _type_ is not part of the module map key, and initially, no other import assertions are supported, so they are also not present.</p>
527+
<p>The module map is keyed by the absolute URL and the _type_. Initially no other import assertions are supported, so they are not present.</p>
525528
</emu-annex>

0 commit comments

Comments
 (0)