Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yoavweiss committed Nov 4, 2024
1 parent dd0ff09 commit c5fd19e
Showing 1 changed file with 48 additions and 51 deletions.
99 changes: 48 additions & 51 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -62951,10 +62951,6 @@ document.body.append(script1, script2);

<dt>"<code data-x="">module</code>"</dt>
<dd>
<p>Let <var>map</var> be <var>settings object</var>'s <span
data-x="concept-settings-object-global">global object</span>'s <span
data-x="concept-global-import-map">import map</span>.</p>

<p>If <var>el</var> does not have an <code data-x="attr-script-integrity">integrity</code>
attribute, then set <var>options</var>'s <span
data-x="concept-script-fetch-options-integrity">integrity metadata</span> to the result of
Expand Down Expand Up @@ -106168,22 +106164,6 @@ new PaymentRequest(&hellip;); // Allowed to use
from the initial empty one. The <span data-x="concept-global-import-map">import map</span> is
only accessed for the resolution of a root <span>module script</span>.</p>

<p>A <dfn>specifier resolution record</dfn> is a <span>struct</span>. It has the following <span
data-x="struct item">items</span>:</p>
<dl>
<dt>A <dfn data-x="specifier-resolution-record-serialized-base-url">serialized base
URL</dfn></dt>
<dd>A <span>string</span>-or-null that represents the base URL of the specifier, when one
exists.</dd>

<dt>A <dfn data-x="specifier-resolution-record-specifier">specifier</dfn></dt>
<dd>A <span>string</span> representing the specifier.</dd>

<dt>An <dfn data-x="specifier-resolution-record-as-url">asURL</dfn></dt>
<dd>A <span>URL</span>-or-null that represents the URL in case of a URL-like module
specifier.</dd>
</dl>

<p>A <span>global object</span> has a <dfn>resolved module set</dfn>, a <span>set</span>
of <span data-x="specifier resolution record">specifier resolution records</span>, initially
empty.</p>
Expand All @@ -106195,10 +106175,6 @@ new PaymentRequest(&hellip;); // Allowed to use
<span data-x="global object">global objects</span> have their module set data structures modified
from the initial empty one.</p>

<p class="note">Implementations can replace
<code data-x="specifier-resolution-record-as-url">asURL</code> with a boolean that indicates that
the specifier is either bare or URL-like that <span>is special</span>.</p>

<hr>

<p>There is always a 1-to-1-to-1 mapping between <span data-x="realm">realms</span>, <span
Expand Down Expand Up @@ -107144,9 +107120,9 @@ document.querySelector("button").addEventListener("click", bound);
<li><p>Return <var>newOptions</var>.</p></li>
</ol>

<p>To <dfn data-x="resolving a module integrity metadata">resolve a module
integrity metadata</dfn>, given a <span>URL</span> <var>url</var> and an <span>environment
settings object</span> <var>settingsObject</var>:</p>
<p>To <dfn data-x="resolving a module integrity metadata">resolve a module integrity
metadata</dfn>, given a <span>URL</span> <var>url</var> and an <span>environment settings
object</span> <var>settingsObject</var>:</p>

<ol>
<li><p>Let <var>map</var> be <var>settingsObject</var>'s <span
Expand Down Expand Up @@ -107702,11 +107678,10 @@ document.querySelector("button").addEventListener("click", bound);
<p>To <dfn data-x="fetch the descendants of and link a module script">fetch the descendants of and
link</dfn> a <span>module script</span> <var>moduleScript</var>, given an <span>environment
settings object</span> <var>fetchClient</var>, a <span
data-x="concept-request-destination">destination</span> <var>destination</var>, an
algorithm <var>onComplete</var>, and an optional <span
data-x="fetching-scripts-perform-fetch">perform the fetch hook</span> <var>performFetch</var>, run
these steps. <var>onComplete</var> must be an algorithm accepting null (on failure) or a
<span>module script</span> (on success).</p>
data-x="concept-request-destination">destination</span> <var>destination</var>, an algorithm
<var>onComplete</var>, and an optional <span data-x="fetching-scripts-perform-fetch">perform the
fetch hook</span> <var>performFetch</var>, run these steps. <var>onComplete</var> must be an
algorithm accepting null (on failure) or a <span>module script</span> (on success).</p>

<ol>
<li><p>Let <var>record</var> be <var>moduleScript</var>'s <span
Expand Down Expand Up @@ -107945,9 +107920,9 @@ document.querySelector("button").addEventListener("click", bound);
<span>module script</span> (on success).</p>

<ol>
<li><p><span>Assert</span>: <var>moduleRequest</var>.[[Attributes]] does not contain any <span>Record</span>
<var>entry</var> such that <var>entry</var>.[[Key]] is not "<code data-x="">type</code>", because
we only asked for "<code data-x="">type</code>" attributes in
<li><p><span>Assert</span>: <var>moduleRequest</var>.[[Attributes]] does not contain any
<span>Record</span> <var>entry</var> such that <var>entry</var>.[[Key]] is not "<code
data-x="">type</code>", because we only asked for "<code data-x="">type</code>" attributes in
<span>HostGetSupportedImportAttributes</span>.</p></li>

<li><p>Let <var>moduleType</var> be the result of running the <span>module type from module
Expand Down Expand Up @@ -108035,7 +108010,7 @@ document.querySelector("button").addEventListener("click", bound);
<p>To <dfn data-x="creating a JavaScript module script">create a JavaScript module script</dfn>,
given a <span>string</span> <var>source</var>, an <span>environment settings
object</span> <var>settings</var>, a <span>URL</span> <var>baseURL</var>, and a <span>script fetch
options</span> <var>options</var>:
options</span> <var>options</var>:</p>

<ol>
<li><p>If <span data-x="concept-environment-noscript">scripting is disabled</span> for
Expand Down Expand Up @@ -108883,7 +108858,7 @@ dictionary <dfn dictionary>PromiseRejectionEventInit</dfn> : <span>EventInit</sp
<div w-nodev>

<p>To <dfn>resolve a module specifier</dfn> given a <span>script</span>-or-null
<var>referringScript</var>, and a <span>string</span> <var>specifier</var>:
<var>referringScript</var>, and a <span>string</span> <var>specifier</var>:</p>

<ol>
<li><p>Let <var>settingsObject</var> and <var>baseURL</var> be null.</p></li>
Expand Down Expand Up @@ -109402,6 +109377,27 @@ dictionary <dfn dictionary>PromiseRejectionEventInit</dfn> : <span>EventInit</sp

<hr>

<p>A <dfn>specifier resolution record</dfn> is a <span>struct</span>. It has the following <span
data-x="struct item">items</span>:</p>
<dl>
<dt>A <dfn data-x="specifier-resolution-record-serialized-base-url">serialized base
URL</dfn></dt>
<dd>A <span>string</span>-or-null that represents the base URL of the specifier, when one
exists.</dd>

<dt>A <dfn data-x="specifier-resolution-record-specifier">specifier</dfn></dt>
<dd>A <span>string</span> representing the specifier.</dd>

<dt>A <dfn data-x="specifier-resolution-record-as-url">specifier as a URL</dfn></dt>
<dd>A <span>URL</span>-or-null that represents the URL in case of a URL-like module
specifier.</dd>
</dl>

<p class="note">Implementations can replace
<span data-x="specifier-resolution-record-as-url">specifier as a URL</span> with a boolean that
indicates that the specifier is either bare or URL-like that <span>is special</span>.</p>


<p>To <dfn>add module to resolved module set</dfn> given an <span>environment settings
object</span> <var>settingsObject</var>, a <span>string</span> <var>serializedBaseURL</var>, a
<span>string</span> <var>normalizedSpecifier</var>, and a <span>URL</span>-or-null
Expand All @@ -109418,7 +109414,8 @@ dictionary <dfn dictionary>PromiseRejectionEventInit</dfn> : <span>EventInit</sp
<var>serializedBaseURL</var>, <span
data-x="specifier-resolution-record-specifier">specifier</span> set to
<var>normalizedSpecifier</var>, and <span
data-x="specifier-resolution-record-as-url">asURL</span> set to <var>asURL</var>.</p></li>
data-x="specifier-resolution-record-as-url">specifier as a URL</span> set to
<var>asURL</var>.</p></li>

<li><p><span data-x="set append">Append</span> <var>record</var> to <var>global</var>'s
<span>resolved module set</span>.</p></li>
Expand Down Expand Up @@ -109607,20 +109604,20 @@ dictionary <dfn dictionary>PromiseRejectionEventInit</dfn> : <span>EventInit</sp
<ol>
<li>
<p>If <var>specifierKey</var> is <var>record</var>'s <span
data-x="specifier-resolution-record-specifier">specifier</span>, or if the following
conditions are all true:</p>
data-x="specifier-resolution-record-specifier">specifier</span>, or if all of the
following conditions are true:</p>

<ol>
<li><p><var>specifierKey</var> ends with U+002F (/).</p></li>
<ul>
<li><p><var>specifierKey</var> ends with U+002F (/);</p></li>

<li><p><var>specifierKey</var> is a <span>code unit prefix</span> of
<var>record</var>'s <span
data-x="specifier-resolution-record-specifier">specifier</span>.</p></li>
data-x="specifier-resolution-record-specifier">specifier</span>;</p></li>

<li><p>Either <var>record</var>'s <span
data-x="specifier-resolution-record-as-url">asURL</span> is null or <span>is
special</span></p></li>
</ol>
<li><p>either <var>record</var>'s <span
data-x="specifier-resolution-record-as-url">specifier as a URL</span> is null or
<span>is special</span>,</p></li>
</ul>

<p>then:</p>

Expand All @@ -109640,7 +109637,7 @@ dictionary <dfn dictionary>PromiseRejectionEventInit</dfn> : <span>EventInit</sp

<p class="note">Implementers are encouraged to implement a more efficient matching
algorithm when working with the <span>resolved module set</span>. As guidance, the number of
resolved/mapped modules in a large application can be in the order of thousands.</p>
resolved/mapped modules in a large application can be on the order of thousands.</p>
</li>

<li><p>If <var>scopePrefix</var> <span data-x="map exists">exists</span> in
Expand Down Expand Up @@ -109715,9 +109712,9 @@ dictionary <dfn dictionary>PromiseRejectionEventInit</dfn> : <span>EventInit</sp
data-x="concept-import-map-imports">imports</span>.</p></li>
</ol>

<p class="note">The above algorithm merges a new import map into the given <span>environment
settings object</span>'s <span>global object</span>'s <span>import map</span>. Let's examine a
few examples:</p>
<p>The above algorithm merges a new import map into the given <span>environment settings
object</span>'s <span>global object</span>'s <span>import map</span>. Let's examine a few
examples:</p>

<div class="example" id="example-import-map-merge-unrelated">
<p>There are two cases when rules of the new import map don't get merged into the existing
Expand Down

0 comments on commit c5fd19e

Please sign in to comment.