Skip to content

Commit c225d56

Browse files
committed
Move check for unknown type assertion to 'create a module script'.
1 parent 6ed4474 commit c225d56

File tree

1 file changed

+31
-20
lines changed

1 file changed

+31
-20
lines changed

source

+31-20
Original file line numberDiff line numberDiff line change
@@ -89661,6 +89661,21 @@ document.querySelector("button").addEventListener("click", bound);
8966189661
<li><p>If <var>url</var> is failure, then asynchronously complete this algorithm with null, and
8966289662
return.</p></li>
8966389663

89664+
<li>
89665+
<p>If <var>moduleRequest</var>.[[Assertions]] has a <span>Record</span> <var>entry</var> such
89666+
that <var>entry</var>.[[Key]] is <code data-x="">"type"</code> then asynchronously complete this
89667+
algorithm with null, and return.</p>
89668+
89669+
<div class="note">
89670+
<p>Currently no non-JS module types are supported, so we conservatively fail if any type
89671+
assertion is provided. When support is added for other module types, the <code
89672+
data-x="">"type"</code> assertion will be used to check that the type of the fetched module
89673+
matches the type expected by the importer.</p>
89674+
89675+
<p>Assertions with unknown keys are ignored.</p>
89676+
</div>
89677+
</li>
89678+
8966489679
<li><p><span>Fetch a single module script</span> given <var>url</var>, <var>settings
8966589680
object</var>, "<code data-x="">script</code>", <var>options</var>, <var>settings object</var>,
8966689681
"<code data-x="">client</code>", <var>moduleRequest</var>, and with the
@@ -90046,21 +90061,6 @@ document.querySelector("button").addEventListener("click", bound);
9004690061
complete with either null (on failure) or a <span>module script</span> (on success).</p>
9004790062

9004890063
<ol>
90049-
<li>
90050-
<p>If <var>moduleRequest</var> was given and <var>moduleRequest</var>.[[Assertions]] has a
90051-
<span>Record</span> <var>entry</var> such that <var>entry</var>.[[Key]] is <code
90052-
data-x="">"type"</code>, then asynchronously complete this algorithm with null, and return.</p>
90053-
90054-
<div class="note">
90055-
<p>Currently no non-JS module types are supported, so we conservatively fail
90056-
if any type is specified. When support is added for other module types, the <code
90057-
data-x="">"type"</code> assertion will be used to check that the type of the fetched module
90058-
matches the type expected by the importer.</p>
90059-
90060-
<p>Assertions with unknown keys are ignored.</p>
90061-
</div>
90062-
</li>
90063-
9006490064
<li><p>Let <var>moduleMap</var> be <var>module map settings object</var>'s <span
9006590065
data-x="concept-settings-object-module-map">module map</span>.</p></li>
9006690066

@@ -90317,7 +90317,9 @@ document.querySelector("button").addEventListener("click", bound);
9031790317
URL</span> and <var>requested.[[Specifier]]</var>.</p></li>
9031890318

9031990319
<li>
90320-
<p>If <var>url</var> is failure, then:</p>
90320+
<p>If <var>url</var> is failure, or if <var>requested</var>.[[Assertions]] has a
90321+
<span>Record</span> <var>entry</var> such that <var>entry</var>.[[Key]] is <code
90322+
data-x="">"type"</code> then:</p>
9032190323

9032290324
<ol>
9032390325
<li><p>Let <var>error</var> be a new <code>TypeError</code> exception.</p></li>
@@ -90330,10 +90332,19 @@ document.querySelector("button").addEventListener("click", bound);
9033090332
</li>
9033190333
</ol>
9033290334

90333-
<p class="note">This step is essentially validating all of the requested module specifiers. We
90334-
treat a module with unresolvable module specifiers the same as one that cannot be parsed; in
90335-
both cases, a syntactic issue makes it impossible to ever contemplate linking the module
90336-
later.</p>
90335+
<div class="note">
90336+
<p>This step is essentially validating all of the requested module specifiers and type
90337+
assertions. We treat a module with unresolvable module specifiers or an unsupported type
90338+
assertion the same as one that cannot be parsed; in both cases, a syntactic issue makes
90339+
it impossible to ever contemplate linking the module later.</p>
90340+
90341+
<p>Currently no non-JS module types are supported, so we conservatively fail if any type
90342+
assertion is provided. When support is added for other module types, the <code
90343+
data-x="">"type"</code> assertion will be used to check that the type of the fetched module
90344+
matches the type expected by the importer.</p>
90345+
90346+
<p>Assertions with unknown keys are ignored.</p>
90347+
</div>
9033790348
</li>
9033890349

9033990350
<li><p>Set <var>script</var>'s <span data-x="concept-script-record">record</span> to

0 commit comments

Comments
 (0)