@@ -2778,6 +2778,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
2778
2778
<li>the <dfn data-x-href="https://fetch.spec.whatwg.org/#requestcredentials"><code>RequestCredentials</code></dfn> enumeration</li>
2779
2779
<li>the <dfn data-x-href="https://fetch.spec.whatwg.org/#requestdestination"><code>RequestDestination</code></dfn> enumeration</li>
2780
2780
<li>the <dfn data-x-href="https://fetch.spec.whatwg.org/#dom-global-fetch"><code>fetch()</code></dfn> method</li>
2781
+ <li><dfn data-x-href="https://fetch.spec.whatwg.org/#concept-body-consume-body">consume body</dfn></li>
2781
2782
<li>
2782
2783
<dfn data-x="concept-response"
2783
2784
data-x-href="https://fetch.spec.whatwg.org/#concept-response">response</dfn> and its
@@ -3116,6 +3117,15 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
3116
3117
3117
3118
<p>User agents that support JavaScript must also implement the <cite>BigInt</cite> proposal. <ref
3118
3119
spec=JSBIGINT></p>
3120
+
3121
+ <p>User agents that support JavaScript must also implement the <cite>JavaScript standard library</cite> proposal.
3122
+ The following terms are defined there, and used in this specification: <ref spec=JSSTDLIB></p>
3123
+ <ul class="brief">
3124
+ <li>The <dfn data-x-href="https://proposal-javascript-standard-library-domenic.now.sh/#sec-createsyntheticmodule">CreateSyntheticModule</dfn> abstract operation</li>
3125
+ <li>The <dfn data-x-href="https://proposal-javascript-standard-library-domenic.now.sh/#sec-setsyntheticmoduleexport">SetSyntheticModuleExport</dfn> abstract operation</li>
3126
+ <li><dfn data-x-href="https://proposal-javascript-standard-library-domenic.now.sh/#sec-synthetic-module-records">Synthetic Module Record</dfn></li>
3127
+ <!-- TODO(littledan): Create a proper reference before landing this patch -->
3128
+ </ul>
3119
3129
</dd>
3120
3130
3121
3131
@@ -86655,7 +86665,7 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
86655
86665
86656
86666
<h5>Definitions</h5>
86657
86667
86658
- <p>A <dfn data-x="concept-script" data-export="">script</dfn> is one of two possible <span
86668
+ <p>A <dfn data-x="concept-script" data-export="">script</dfn> is one of three possible <span
86659
86669
data-x="struct">structs</span>. All scripts have:</p>
86660
86670
86661
86671
<dl>
@@ -86668,7 +86678,9 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
86668
86678
86669
86679
<dd><p>Either a <span>Script Record</span>, for <span data-x="classic script">classic
86670
86680
scripts</span>; a <span>Source Text Module Record</span>, for <span data-x="module
86671
- script">module scripts</span>; or null. In the former two cases, it represents a parsed script;
86681
+ script">module scripts</span>; a <span>Synthetic Module Record</span> for <span
86682
+ data-x="JSON module script">JSON module scripts</span>; or null. In the
86683
+ former two cases, it represents a parsed script; in the third case, a parsed JSON document;
86672
86684
null represents a failure parsing.</p></dd>
86673
86685
86674
86686
<dt>A <dfn data-dfn-for="script" data-export="" data-x="concept-script-parse-error">parse
@@ -86721,6 +86733,10 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
86721
86733
data-x="concept-script">script</span>. It has no additional <span data-x="struct
86722
86734
item">items</span>.</p>
86723
86735
86736
+ <p>A <dfn data-export="">JSON module script</dfn> is another type of <span
86737
+ data-x="concept-script">script</span>. It has no additional <span data-x="struct
86738
+ item">items</span>.</p>
86739
+
86724
86740
<p>The <dfn>active script</dfn> is determined by the following algorithm:</p>
86725
86741
86726
86742
<ol>
@@ -87359,25 +87375,63 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
87359
87375
87360
87376
<li><p><var>response</var>'s <span data-x="concept-response-status">status</span> is not an
87361
87377
<span>ok status</span></p></li>
87378
+ </ul>
87379
+ </li>
87362
87380
87363
- <li>
87364
- <p>The result of <span data-x="extract a MIME type">extracting a MIME type</span> from
87365
- <var>response</var>'s <span data-x="concept-response-header-list">header list</span> is not a
87366
- <span>JavaScript MIME type< /span></p>
87381
+ <li>
87382
+ <p>Let <var>type</var> be the result of <span data-x="extract a MIME type">extracting a
87383
+ MIME type</span> from <var>response</var>'s <span data-x="concept-response-header-list">header
87384
+ list< /span>. </p>
87367
87385
87368
- <p class="note">For historical reasons, <span data-x="fetch a classic script">fetching a
87369
- classic script</span> does not include MIME type checking. In contrast, module scripts will
87370
- fail to load if they are not of a correct MIME type.</p>
87371
- </li>
87372
- </ul>
87386
+ <p class="note">For historical reasons, <span data-x="fetch a classic script">fetching a
87387
+ classic script</span> does not include MIME type checking. In contrast, module scripts'
87388
+ interpretation is driven by their MIME type, and they will fail to load if they are not of
87389
+ a supported MIME type.</p>
87373
87390
</li>
87374
87391
87375
- <li><p>Let <var>source text</var> be the result of <span data-x="UTF-8 decode">UTF-8
87376
- decoding</span> <var>response</var>'s <span data-x="concept-response-body">body</span>.</p></li>
87392
+ <li><p>Let <var>module script</var> be null.</p></li>
87377
87393
87378
- <li><p>Let <var>module script</var> be the result of <span>creating a module script</span> given
87379
- <var>source text</var>, <var>module map settings object</var>, <var>response</var>'s <span
87380
- data-x="concept-response-url">url</span>, and <var>options</var>.</p></li>
87394
+ <li>
87395
+ <p>If <var>type</var> is a <span>JavaScript MIME type</span>, then:</p>
87396
+
87397
+ <ol>
87398
+ <li><p>Let <var>source text</var> be the result of <span data-x="UTF-8 decode">UTF-8
87399
+ decoding</span> <var>response</var>'s <span data-x="concept-response-body">body</span>.</p></li>
87400
+
87401
+ <li><p>Set <var>module script</var> to the result of <span>creating a module script</span> given
87402
+ <var>source text</var>, <var>module map settings object</var>, <var>response</var>'s <span
87403
+ data-x="concept-response-url">url</span>, and <var>options</var>.</p></li>
87404
+ </ol>
87405
+ </li>
87406
+
87407
+ <li>
87408
+ <p>If <var>type</var> is a <span>JSON MIME type</span>, then:</p>
87409
+
87410
+ <ol>
87411
+ <li><p>Set <var>module script</var> to a new <span>JSON module script</span> that this algorithm
87412
+ will subsequently initialize.</p></li>
87413
+
87414
+ <li>
87415
+ <p>Let <var>json</var> be the result of running <span>consume body</span> on
87416
+ <var>response</var> with <i>JSON</i>.</p>
87417
+
87418
+ <p>If this throws an exception, catch it, and set <var>module script</var>'s
87419
+ <span data-x="concept-script-parse-error">parse error</span> to that exception.</p>
87420
+ </li>
87421
+
87422
+ <li>
87423
+ <p>If no exception was thrown, set <var>module script</var>'s <span
87424
+ data-x="concept-script-record">record</span> to <span>CreateSyntheticModule</span>
87425
+ (« "default" », the following steps, <var>module map settings object</var>'s
87426
+ <span data-x="environment settings object's Realm">Realm</span>, <var>json</var>) with the
87427
+ following steps given <var>module</var> as an argument:</p>
87428
+ <ol>
87429
+ <li>1. <span>SetSyntheticModuleExport</span>(<var>module</var>, "default",
87430
+ <var>module</var>.[[HostDefined]]).</li>
87431
+ </ol>
87432
+ </li>
87433
+ </ol>
87434
+ </li>
87381
87435
87382
87436
<li>
87383
87437
<p><span data-x="map set">Set</span> <var>moduleMap</var>[<var>url</var>] to <var>module
@@ -121954,6 +122008,9 @@ INSERT INTERFACES HERE
121954
122008
<dt id="refsJSINTL">[JSINTL]</dt>
121955
122009
<dd><cite><a href="https://tc39.github.io/ecma402/">ECMAScript Internationalization API Specification</a></cite>. Ecma International.</dd>
121956
122010
122011
+ <dt id="refsJSSTDLIB">[JSSTDLIB]</dt>
122012
+ <dd><cite><a href="https://github.com/tc39/proposal-javascript-standard-library/">JavaScript Standard Library</a></cite>. Ecma International.</dd>
122013
+
121957
122014
<dt id="refsJSON">[JSON]</dt>
121958
122015
<dd><cite><a href="https://tools.ietf.org/html/rfc7159">The JavaScript Object Notation (JSON) Data Interchange Format</a></cite>, T. Bray. IETF.</dd>
121959
122016
0 commit comments