Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 65 additions & 5 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -3189,6 +3189,13 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li>The <dfn data-x="js-HostGetCodeForEval" data-x-href="https://tc39.es/proposal-dynamic-code-brand-checks/#sec-hostgetcodeforeval">HostGetCodeForEval</dfn> abstract operation</li>
</ul>

<p>User agents that support JavaScript must also implement the <cite>Import Text</cite> proposal.
The following term is defined there, and used in this specification: <ref>JSIMPORTTEXT</ref></p>

<ul class="brief">
<li>The <dfn data-x="js-CreateTextModule" data-x-href="https://tc39.es/proposal-import-text/#sec-create-text-module">CreateTextModule</dfn> abstract operation</li>
</ul>

<p>User agents that support JavaScript must also implement <cite>ECMAScript
Internationalization API</cite>. <ref>JSINTL</ref></p>

Expand Down Expand Up @@ -116056,7 +116063,8 @@ document.querySelector("button").addEventListener("click", bound);
script">JavaScript module scripts</span>;</p></li>

<li><p>a <span>Synthetic Module Record</span>, for <span data-x="CSS module script">CSS module
scripts</span> and <span data-x="JSON module script">JSON module scripts</span>;</p></li>
scripts</span>, <span data-x="JSON module script">JSON module scripts</span>, and
<span data-x="text module script">text module scripts</span>;</p></li>

<li><p>a <span>WebAssembly Module Record</span>, for <span data-x="WebAssembly module
script">WebAssembly module scripts</span>; or</p></li>
Expand Down Expand Up @@ -116166,6 +116174,15 @@ document.querySelector("button").addEventListener("click", bound);
-->
</li>

<li>
<div algorithm>
<p>A <span>module script</span> is a <dfn export>text module script</dfn> if its <span
data-x="concept-script-record">record</span> is a <span>Synthetic Module Record</span>, and it
was created via the <span data-x="creating a text module script">create a text module
script</span> algorithm. Text module scripts represent a text document.</p>
</div>
</li>

<li>
<div algorithm>
<p>A <span>module script</span> is a <dfn export>WebAssembly module script</dfn> if
Expand All @@ -116175,11 +116192,11 @@ document.querySelector("button").addEventListener("click", bound);
</li>
</ul>

<p class="note">As CSS style sheets and JSON documents do not import dependent modules, and do not
<p class="note">As CSS style sheets, JSON documents, and text do not import dependent modules, and do not
throw exceptions on evaluation, the <span data-x="concept-script-script-fetch-options">fetch
options</span> and <span data-x="concept-script-base-url">base URL</span> of <span data-x="CSS
module script">CSS module scripts</span> and <span data-x="JSON module script">JSON module
scripts</span> and are always null.</p>
module script">CSS module scripts</span>, <span data-x="JSON module script">JSON module
scripts</span>, and <span data-x="text module script">text module scripts</span> are always null.</p>

<div algorithm>
<p>The <dfn>active script</dfn> is determined by the following algorithm:</p>
Expand Down Expand Up @@ -117115,6 +117132,10 @@ document.querySelector("button").addEventListener("click", bound);
<li><p>Let <var>sourceText</var> be the result of <span data-x="UTF-8 decode">UTF-8
decoding</span> <var>bodyBytes</var>.</p></li>

<li><p>If <var>moduleType</var> is "<code data-x="">text</code>", then set
<var>moduleScript</var> to the result of <span>creating a text module script</span> given
<var>sourceText</var> and <var>settingsObject</var>.</p></li>

<li><p>If <var>mimeType</var> is a <span>JavaScript MIME type</span> and <var>moduleType</var>
is "<code data-x="">javascript-or-wasm</code>", then set <var>moduleScript</var> to the result of
<span>creating a JavaScript module script</span> given <var>sourceText</var>,
Expand Down Expand Up @@ -117442,6 +117463,38 @@ document.querySelector("button").addEventListener("click", bound);
</ol>
</div>

<div algorithm>
<p>To <dfn data-x="creating a text module script">create a text module script</dfn>, given a
string <var>text</var> and an <span>environment settings object</span> <var>settings</var>:</p>

<ol>
<li><p>Let <var>script</var> be a new <span>module script</span> that this algorithm will
subsequently initialize.</p></li>

<li><p>Set <var>script</var>'s <span data-x="concept-script-settings-object">settings
object</span> to <var>settings</var>.</p></li>

<li><p>Set <var>script</var>'s <span data-x="concept-script-base-url">base URL</span> and
<span data-x="concept-script-script-fetch-options">fetch options</span> to null.</p></li>

<li><p>Set <var>script</var>'s <span data-x="concept-script-parse-error">parse error</span> and
<span data-x="concept-script-error-to-rethrow">error to rethrow</span> to null.</p></li>

<li>
<p>Let <var>result</var> be <span>CreateTextModule</span>(<var>text</var>).</p>

<p>If this throws an exception, catch it, and set <var>script</var>'s <span
data-x="concept-script-parse-error">parse error</span> to that exception, and return
<var>script</var>.</p>
</li>

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

<li><p>Return <var>script</var>.</p></li>
</ol>
</div>

<div algorithm>
<p>The <dfn>module type from module request</dfn> steps, given a <span>ModuleRequest
Record</span> <var>moduleRequest</var>, are as follows:</p>
Expand Down Expand Up @@ -117480,7 +117533,8 @@ document.querySelector("button").addEventListener("click", bound);

<ol>
<li><p>If <var>moduleType</var> is not "<code data-x="">javascript-or-wasm</code>", "<code
data-x="">css</code>", or "<code data-x="">json</code>", then return false.</p></li>
data-x="">css</code>", "<code data-x="">json</code>", or "<code data-x="">text</code>", then
return false.</p></li>

<li><p>If <var>moduleType</var> is "<code data-x="">css</code>" and the
<code>CSSStyleSheet</code> interface is not <span data-x="idl-exposed">exposed</span> in
Expand All @@ -117503,6 +117557,9 @@ document.querySelector("button").addEventListener("click", bound);
<li>If <var>moduleType</var> is "<code data-x="">css</code>", then return "<code
data-x="">style</code>".</li>

<li>If <var>moduleType</var> is "<code data-x="">text</code>", then return "<code
data-x="">text</code>".</li>

<li>Return <var>defaultDestination</var>.</li>
</ol>
</div>
Expand Down Expand Up @@ -155474,6 +155531,9 @@ INSERT INTERFACES HERE
<dt id="refsJSDYNAMICCODEBRANDCHECKS">[JSDYNAMICCODEBRANDCHECKS]</dt>
<dd><cite><a href="https://tc39.es/proposal-dynamic-code-brand-checks/">Dynamic code brand checks</a></cite>. Ecma International.</dd>

<dt id="refsJSIMPORTTEXT">[JSIMPORTTEXT]</dt>
<dd><cite><a href="https://tc39.es/proposal-import-text/">Import Text</a></cite>. Ecma International.</dd>

<dt id="refsJSINTL">[JSINTL]</dt>
<dd><cite><a href="https://tc39.es/ecma402/">ECMAScript Internationalization API Specification</a></cite>. Ecma International.</dd>

Expand Down
Loading