Skip to content

Commit 73af751

Browse files
domenicannevk
authored andcommitted
Fix some callers of "create a module script"
This algorithm was not always being called with the correct arguments; in particular, when creating an inline module script, the cryptographic nonce, parser state, and credentials mode were not being set correctly. This fixes that call site and also updates its argument order to be consistent with other nearby algorithms.
1 parent 9b22d03 commit 73af751

File tree

1 file changed

+29
-30
lines changed

1 file changed

+29
-30
lines changed

source

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -57838,6 +57838,22 @@ o............A....e
5783857838
<li><p>Let <var>CORS setting</var> be the current state of the element's <code
5783957839
data-x="attr-script-crossorigin">crossorigin</code> content attribute.</p></li>
5784057840

57841+
<li>
57842+
<p>Let <var>module script credentials mode</var> be determined by switching on <var>CORS
57843+
setting</var>:</p>
57844+
57845+
<dl class="switch">
57846+
<dt><span data-x="attr-crossorigin-none">No CORS</span></dt>
57847+
<dd>"<code data-x="">omit</code>"</dd>
57848+
57849+
<dt><span data-x="attr-crossorigin-anonymous">Anonymous</span></dt>
57850+
<dd>"<code data-x="">same-origin</code>"</dd>
57851+
57852+
<dt><span data-x="attr-crossorigin-none">Use Credentials</span></dt>
57853+
<dd>"<code data-x="">include</code>"</dd>
57854+
</dl>
57855+
</li>
57856+
5784157857
<li>
5784257858

5784357859
<p>If the <code>script</code> element has a <code data-x="attr-script-nonce">nonce</code>
@@ -57891,27 +57907,9 @@ o............A....e
5789157907

5789257908
<dt>"<code data-x="">module</code>"</dt>
5789357909
<dd>
57894-
<ol>
57895-
<li>
57896-
<p>Let <var>credentials mode</var> be determined by switching on <var>CORS
57897-
setting</var>:</p>
57898-
57899-
<dl class="switch">
57900-
<dt><span data-x="attr-crossorigin-none">No CORS</span></dt>
57901-
<dd>"<code data-x="">omit</code>"</dd>
57902-
57903-
<dt><span data-x="attr-crossorigin-anonymous">Anonymous</span></dt>
57904-
<dd>"<code data-x="">same-origin</code>"</dd>
57905-
57906-
<dt><span data-x="attr-crossorigin-none">Use Credentials</span></dt>
57907-
<dd>"<code data-x="">include</code>"</dd>
57908-
</dl>
57909-
</li>
57910-
57911-
<li><p><span>Fetch a module script tree</span> given <var>url</var>, <var>settings</var>,
57912-
"<code data-x="">script</code>", <var>cryptographic nonce</var>, <var>parser state</var>,
57913-
and <var>credentials mode</var>.</p></li>
57914-
</ol>
57910+
<p><span>Fetch a module script tree</span> given <var>url</var>, <var>settings</var>,
57911+
"<code data-x="">script</code>", <var>cryptographic nonce</var>, <var>parser state</var>,
57912+
and <var>module script credentials mode</var>.</p>
5791557913
</dd>
5791657914
</dl>
5791757915

@@ -57971,8 +57969,9 @@ o............A....e
5797157969
document</span>'s <span>document base URL</span>.</p></li>
5797257970

5797357971
<li><p>Let <var>script</var> be the result of <span>creating a module script</span> using
57974-
<var>source text</var>, <var>settings</var>, <var>base URL</var>, and <var>CORS
57975-
setting</var>.</p></li>
57972+
<var>source text</var>, <var>settings</var>, <var>base URL</var>, <var>cryptographic
57973+
nonce</var>, <var>parser state</var>, and <var>module script credentials
57974+
mode</var>.</p></li>
5797657975

5797757976
<li><p>If this returns null, set <span data-x="concept-script-script">the script's
5797857977
script</span> to null and abort these substeps; <span>the script is ready</span>.</p></li>
@@ -86838,8 +86837,8 @@ interface <dfn>NavigatorOnLine</dfn> {
8683886837

8683986838
<li><p>Let <var>module script</var> be the result of <span>creating a module script</span> given
8684086839
<var>source text</var>, <var>module map settings object</var>, <var>response</var>'s <span
86841-
data-x="concept-response-url">url</span>, <var>credentials mode</var>, and <var>cryptographic
86842-
nonce</var>.</p></li>
86840+
data-x="concept-response-url">url</span>, <var>cryptographic
86841+
nonce</var>, <var>parser state</var>, and <var>credentials mode</var>.</p></li>
8684386842

8684486843
<li>
8684586844
<p>Set the value of the entry in <var>module map</var> whose key is <var>url</var> to
@@ -86942,8 +86941,8 @@ interface <dfn>NavigatorOnLine</dfn> {
8694286941
</ol>
8694386942

8694486943
<p>To <dfn data-x="creating a module script">create a module script</dfn>, given some script
86945-
source, an <span>environment settings object</span>, a script base URL, a credentials mode, a
86946-
cryptographic nonce, and a parser state:</p>
86944+
source, an <span>environment settings object</span>, a script base URL, a cryptographic nonce, a
86945+
parser state, and a credentials mode:</p>
8694786946

8694886947
<ol>
8694986948

@@ -86975,15 +86974,15 @@ interface <dfn>NavigatorOnLine</dfn> {
8697586974
<li><p>Set <var>script</var>'s <span data-x="concept-module-script-base-url">base URL</span> to
8697686975
the script base URL provided.</p></li>
8697786976

86978-
<li><p>Set <var>script</var>'s <span data-x="concept-module-script-credentials-mode">credentials
86979-
mode</span> to the credentials mode provided.</p></li>
86980-
8698186977
<li><p>Set <var>script</var>'s <span data-x="concept-module-script-nonce">cryptographic
8698286978
nonce</span> to the cryptographic nonce provided.</p></li>
8698386979

8698486980
<li><p>Set <var>script</var>'s <span data-x="concept-module-script-parser">parser state</span>
8698586981
to the parser state.</p></li>
8698686982

86983+
<li><p>Set <var>script</var>'s <span data-x="concept-module-script-credentials-mode">credentials
86984+
mode</span> to the credentials mode provided.</p></li>
86985+
8698786986
<li><p>Return <var>script</var>.</p></li>
8698886987

8698986988
</ol>

0 commit comments

Comments
 (0)