Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: Update HostEnsureCanCompileStrings definition #10204

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 42 additions & 8 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -3008,7 +3008,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li>The <dfn data-x="js-HostEnqueuePromiseJob" data-x-href="https://tc39.es/ecma262/#sec-hostenqueuepromisejob">HostEnqueuePromiseJob</dfn> abstract operation</li>
<li>The <dfn data-x="js-HostEnqueueTimeoutJob" data-x-href="https://tc39.es/ecma262/#sec-hostenqueuetimeoutjob">HostEnqueueTimeoutJob</dfn> abstract operation</li>
<li>The <dfn data-x="js-HostEnsureCanAddPrivateElement" data-x-href="https://tc39.es/ecma262/#sec-hostensurecanaddprivateelement">HostEnsureCanAddPrivateElement</dfn> abstract operation</li>
<li>The <dfn data-x="js-HostEnsureCanCompileStrings" data-x-href="https://tc39.es/ecma262/#sec-hostensurecancompilestrings">HostEnsureCanCompileStrings</dfn> abstract operation</li>
<li>The <dfn data-x="js-HostLoadImportedModule" data-x-href="https://tc39.es/proposal-import-attributes/#sec-HostLoadImportedModule">HostLoadImportedModule</dfn> abstract operation</li>
lukewarlow marked this conversation as resolved.
Show resolved Hide resolved
<li>The <dfn data-x="js-HostMakeJobCallback" data-x-href="https://tc39.es/ecma262/#sec-hostmakejobcallback">HostMakeJobCallback</dfn> abstract operation</li>
<li>The <dfn data-x="js-HostPromiseRejectionTracker" data-x-href="https://tc39.es/ecma262/#sec-host-promise-rejection-tracker">HostPromiseRejectionTracker</dfn> abstract operation</li>
lukewarlow marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -3071,6 +3070,15 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li><dfn data-x-href="https://tc39.es/ecma262/#table-49">The <var>TypedArray</var> Constructors</dfn> table</li>
</ul>

<p>Users agents that support JavaScript must also implement the <cite>Dynamic Code Brand
Checks</cite> proposal. The following terms are defined there, and used in this specification:
<ref>JSDYNAMICCODEBRANDCHECKS</ref></p>

<ul class="brief">
<li>The <dfn data-x="js-HostEnsureCanCompileStrings" data-x-href="https://tc39.es/proposal-dynamic-code-brand-checks/#sec-hostensurecancompilestrings">HostEnsureCanCompileStrings</dfn> abstract operation</li>
<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>Users agents that support JavaScript must also implement <cite>ECMAScript
Internationalization API</cite>. <ref>JSINTL</ref></p>

Expand Down Expand Up @@ -4608,6 +4616,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<ul class="brief">
<li><dfn data-x="tt-htmlstring" data-x-href="https://w3c.github.io/trusted-types/dist/spec/#typedefdef-htmlstring"><code>HTMLString</code></dfn></li>
<li><dfn data-x="tt-scripturlstring" data-x-href="https://w3c.github.io/trusted-types/dist/spec/#typedefdef-scripturlstring"><code>ScriptURLString</code></dfn></li>
<li><dfn data-x="tt-trustedscript" data-x-href="https://w3c.github.io/trusted-types/dist/spec/#trusted-script"><code>TrustedScript</code></dfn></li>
<li><dfn data-x="tt-trustedscript-data" data-x-href="https://w3c.github.io/trusted-types/dist/spec/#trustedscript-data"><code>data</code></dfn></li>
</ul>
</dd>
</dl>
Expand Down Expand Up @@ -108668,18 +108678,39 @@ dictionary <dfn dictionary>PromiseRejectionEventInit</dfn> : <span>EventInit</sp
security &mdash; that make implementation of private field semantics challenging, so our
implementation simply rejects those objects.</p>

<h5><dfn data-x="the-hostensurecancompilestrings-implementation">HostEnsureCanCompileStrings</dfn>(<var>realm</var>)</h5>
<h5><dfn
data-x="the-hostensurecancompilestrings-implementation">HostEnsureCanCompileStrings</dfn>(<var>realm</var>,
<var>parameterStrings</var>, <var>bodyString</var>, <var>compilationType</var>,
<var>parameterArgs</var>, <var>bodyArg</var>)</h5>

<p>JavaScript contains an <span>implementation-defined</span> <span
data-x="js-HostEnsureCanCompileStrings">HostEnsureCanCompileStrings</span>(<var>realm</var>)
abstract operation. User agents must use the following implementation: <ref>JAVASCRIPT</ref>
data-x="js-HostEnsureCanCompileStrings">HostEnsureCanCompileStrings</span> abstract operation,
redefined by the <cite>Dynamic Code Brand Checks</cite> proposal. User agents must use
the following implementation: <ref>JAVASCRIPT</ref> <ref>JSDYNAMICCODEBRANDCHECKS</ref>

<ol>
<li><p>Perform ? <span
data-x="csp-EnsureCSPDoesNotBlockStringCompilation">EnsureCSPDoesNotBlockStringCompilation</span>(<var>realm</var>).
data-x="csp-EnsureCSPDoesNotBlockStringCompilation">EnsureCSPDoesNotBlockStringCompilation</span>(<var>realm</var>,
<var>parameterStrings</var>, <var>bodyString</var>, <var>codeString</var>,
<var>compilationType</var>, <var>parameterArgs</var>, <var>bodyArg</var>).
<ref>CSP</ref></p></li>
</ol>

<h5><dfn
data-x="the-hostgetcodeforeval-implementation">HostGetCodeForEval</dfn>(<var>argument</var>)</h5>

<p>The <cite>Dynamic Code Brand Checks</cite> proposal contains an
<span>implementation-defined</span> <span
data-x="js-HostGetCodeForEval">HostGetCodeForEval</span>(<var>argument</var>) abstract operation.
User agents must use the following implementation: <ref>JSDYNAMICCODEBRANDCHECKS</ref>

<ol>
<li><p>If <var>argument</var> is a <code data-x="tt-trustedscript">TrustedScript</code> object,
then return <var>argument</var>'s <span data-x="tt-trustedscript-data">data</span>.</p></li>

<li><p>Otherwise, return no-code.</p></li>
</ol>

<h5 id="the-hostpromiserejectiontracker-implementation"><dfn>HostPromiseRejectionTracker</dfn>(<var>promise</var>, <var>operation</var>)</h5>

<p>JavaScript contains an <span>implementation-defined</span> <span
Expand Down Expand Up @@ -113239,9 +113270,9 @@ enum <dfn enum>DOMParserSupportedType</dfn> {
<li><p><span>Assert</span>: <var>handler</var> is a string.</p></li>

<li><p>Perform <span
data-x="the-hostensurecancompilestrings-implementation">HostEnsureCanCompileStrings</span>(<var>realm</var>).
If this throws an exception, catch it, <span>report the exception</span>, and abort these
steps.</p></li>
data-x="csp-EnsureCSPDoesNotBlockStringCompilation">EnsureCSPDoesNotBlockStringCompilation</span>(<var>realm</var>,
« », <var>handler</var>, <var>handler</var>, timer, « », <var>handler</var>). If this throws
an exception, catch it, <span>report the exception</span>, and abort these steps.</p></li>

<li><p>Let <var>settings object</var> be <var>global</var>'s <span>relevant settings
object</span>.</p></li>
Expand Down Expand Up @@ -142798,6 +142829,9 @@ INSERT INTERFACES HERE
<dt id="refsJSERRORSTACKS">[JSERRORSTACKS]</dt>
<dd>(Non-normative) <cite><a href="https://tc39.es/proposal-error-stacks/">Error Stacks</a></cite>. Ecma International.</dd>

<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="refsJSIMPORTATTRIBUTES">[JSIMPORTATTRIBUTES]</dt>
<dd><cite><a href="https://tc39.es/proposal-import-attributes/">Import attributes</a></cite>. Ecma International.</dd>

Expand Down