You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
name <var>trustedTypeName</var>, with its <code>[[Data]]</code> internal slot value
2004
2004
set to <var>dataString</var>.</p>
2005
2005
<lidata-md>
2006
-
<p>If <var>trustedObject</var> is a <codeclass="idl"><adata-link-type="idl" href="#trustedscript" id="ref-for-trustedscript⑥">TrustedScript</a></code>, set its <code>[[HostDefinedCodeLike]]</code> internal slot value to the value in its <code>[[Data]]</code> slot.</p>
2006
+
<p>If <var>trustedObject</var> is a <codeclass="idl"><adata-link-type="idl" href="#trustedscript" id="ref-for-trustedscript⑥">TrustedScript</a></code>, set its <code>[[HostDefinedIsCodeLike]]</code> internal slot value to <code>true</code>.</p>
2007
2007
<pclass="note" role="note"><spanclass="marker">Note:</span> This adds an integration point with <ahref="https://tc39.es/proposal-dynamic-code-brand-checks/">dynamic-code-brand-checks proposal</a>.</p>
name <var>trustedTypeName</var>, with its <code>[[Data]]</code> internal slot value
2113
2113
set to <var>dataString</var>.</p>
2114
2114
<lidata-md>
2115
-
<p>If <var>trustedObject</var> is a <codeclass="idl"><adata-link-type="idl" href="#trustedscript" id="ref-for-trustedscript⑦">TrustedScript</a></code>, set its <code>[[HostDefinedCodeLike]]</code> internal slot value to the value in its <code>[[Data]]</code> slot.</p>
2115
+
<p>If <var>trustedObject</var> is a <codeclass="idl"><adata-link-type="idl" href="#trustedscript" id="ref-for-trustedscript⑦">TrustedScript</a></code>, set its <code>[[HostDefinedIsCodeLike]]</code> internal slot value to <code>true</code>.</p>
2116
2116
<pclass="note" role="note"><spanclass="marker">Note:</span> This adds an integration point with <ahref="https://tc39.es/proposal-dynamic-code-brand-checks/">dynamic-code-brand-checks proposal</a>.</p>
Given a <ahref="https://tc39.es/ecma262/multipage/#realm">realm</a> (<var>calleeRealm</var>), a list of strings (<var>parameterStrings</var>), a string (<var>bodyString</var>),
2819
-
<ins> a string (<var>source</var>), an enum (<var>compilationType</var>), and a boolean <var>wasCodeLike</var></ins>
2820
-
, this algorithm returns normally if compilation is allowed, and
2821
-
throws an "<code>EvalError</code>" if not:
2819
+
<ins> a string (<var>source</var>), an enum (<var>compilationType</var>), a list of ECMAScript language values (<var>parameterArgs</var>), and an ECMAScript language value (<var>bodyArg</var>), this algorithm returns normally if compilation is allowed, and
2820
+
throws an "<code>EvalError</code>" if not:</ins>
2822
2821
</p>
2823
2822
<ol>
2824
-
<lidata-md>
2825
-
<ins>If <var>wasCodeLike</var> is true, let <var>sourceToValidate</var> be a new instance of
2826
-
the <codeclass="idl"><adata-link-type="idl" href="#trustedscript" id="ref-for-trustedscript①⑦">TrustedScript</a></code> interface, with its <code>[[Data]]</code> internal slot value
2827
-
set to <var>source</var>. Otherwise, let <var>sourceToValidate</var> be <var>source</var>.</ins>
2828
2823
<lidata-md>
2829
2824
<ins>Let <var>compilationSink</var> be <code>"Function"</code> if <var>compilationType</var> is <code>*FUNCTION*</code>, otherwise <code>"Eval"</code>.</ins>
2825
+
<lidata-md>
2826
+
<ins>Let <var>isTrusted</var> be <code>true</code>.</ins>
2827
+
<lidata-md>
2828
+
<ins>If <var>bodyArg</var> is not a <codeclass="idl"><adata-link-type="idl" href="#trustedscript" id="ref-for-trustedscript①⑦">TrustedScript</a></code> object, set <var>isTrusted</var> to <code>false</code>.</ins>
2829
+
<lidata-md>
2830
+
<ins>
2831
+
If <var>isTrusted</var> is <code>true</code> then:
2832
+
<ol>
2833
+
<lidata-md>
2834
+
<ins>If <var>bodyString</var> is not equal to <var>bodyArg</var>’s <code>[[Data]]</code> internal slot, set <var>isTrusted</var> to <code>false</code>.</ins>
2835
+
</ol>
2836
+
</ins>
2837
+
<lidata-md>
2838
+
<ins>If <var>isTrusted</var> is <code>true</code>, then:</ins>
2839
+
<ol>
2840
+
<lidata-md>
2841
+
<ins> For each <var>arg</var> in <var>parameterArgs</var>:</ins>
2842
+
<ol>
2843
+
<lidata-md>
2844
+
<ins>Let <var>index</var> be the index of <var>arg</var> in <var>parameterArgs</var>.</ins>
2845
+
<lidata-md>
2846
+
<ins>If <var>arg</var> is not a <codeclass="idl"><adata-link-type="idl" href="#trustedscript" id="ref-for-trustedscript①⑧">TrustedScript</a></code> object, set <var>isTrusted</var> to <code>false</code>.</ins>
2847
+
<lidata-md>
2848
+
<ins>If <var>isTrusted</var> is <code>true</code>, then:</ins>
2849
+
<ol>
2850
+
<lidata-md>
2851
+
<ins>if <var>parameterStrings</var>[<var>index</var>] is not equal to <var>arg</var>’s <code>[[Data]]</code> internal slot, set <var>isTrusted</var> to <code>false</code>.</ins>
2852
+
</ol>
2853
+
</ol>
2854
+
</ol>
2855
+
<lidata-md>
2856
+
<ins>If <var>isTrusted</var> is <code>true</code>, let <var>sourceToValidate</var> be a new instance of
2857
+
the <codeclass="idl"><adata-link-type="idl" href="#trustedscript" id="ref-for-trustedscript①⑨">TrustedScript</a></code> interface, with its <code>[[Data]]</code> internal slot value
2858
+
set to <var>source</var>. Otherwise, let <var>sourceToValidate</var> be <var>source</var>.</ins>
2830
2859
<lidata-md>
2831
2860
<ins>
2832
2861
Let <var>sourceString</var> be the result of executing the <adata-link-type="abstract-op" href="#abstract-opdef-get-trusted-type-compliant-string" id="ref-for-abstract-opdef-get-trusted-type-compliant-string⑥">Get Trusted Type compliant string</a> algorithm, with:
0 commit comments