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
Copy file name to clipboardExpand all lines: spec/index.bs
+15-5Lines changed: 15 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -973,7 +973,7 @@ a string |value| and a list |arguments|, execute the following steps:
973
973
1. Let |trustedObject| be a new instance of an interface with a type
974
974
name |trustedTypeName|, with its `[[Data]]` internal slot value
975
975
set to |dataString|.
976
-
1. If |trustedObject| is a {{TrustedScript}}, set its `[[HostDefinedCodeLike]]` internal slot value to the value in its `[[Data]]` slot.
976
+
1. If |trustedObject| is a {{TrustedScript}}, set its `[[HostDefinedIsCodeLike]]` internal slot value to `true`.
977
977
978
978
Note: This adds an integration point with [dynamic-code-brand-checks proposal](https://tc39.es/proposal-dynamic-code-brand-checks/).
979
979
1. Return |trustedObject|.
@@ -1061,7 +1061,7 @@ Given a {{TrustedType}} type (|expectedType|), a [=realm/global object=] (|globa
1061
1061
1. Let |trustedObject| be a new instance of an interface with a type
1062
1062
name |trustedTypeName|, with its `[[Data]]` internal slot value
1063
1063
set to |dataString|.
1064
-
1. If |trustedObject| is a {{TrustedScript}}, set its `[[HostDefinedCodeLike]]` internal slot value to the value in its `[[Data]]` slot.
1064
+
1. If |trustedObject| is a {{TrustedScript}}, set its `[[HostDefinedIsCodeLike]]` internal slot value to `true`.
1065
1065
1066
1066
Note: This adds an integration point with [dynamic-code-brand-checks proposal](https://tc39.es/proposal-dynamic-code-brand-checks/).
1067
1067
1. Return |trustedObject|.
@@ -1749,14 +1749,24 @@ The Trusted Types portion of this algorithm uses |calleeRealm| and its CSP setti
1749
1749
</pre>
1750
1750
</div>
1751
1751
1752
-
Given a [[ECMA-262#realm|realm]] (|calleeRealm|), a list of strings (|parameterStrings|), a string (|bodyString|), <ins> a string (|source|), an enum (|compilationType|), and a boolean |wasCodeLike|</ins>, this algorithm returns normally if compilation is allowed, and
1752
+
Given a [[ECMA-262#realm|realm]] (|calleeRealm|), a list of strings (|parameterStrings|), a string (|bodyString|), <ins> a string (|source|), an enum (|compilationType|), a list of ECMAScript language values (|parameterArgs|), and an ECMAScript language value (|bodyArg|), this algorithm returns normally if compilation is allowed, and
1753
1753
throws an "`EvalError`" if not:
1754
1754
1755
-
1. <ins>If |wasCodeLike| is true, let |sourceToValidate| be a new instance of
1755
+
1. <ins>Let |compilationSink| be `"Function"` if |compilationType| is `*FUNCTION*`, otherwise `"Eval"`.</ins>
1756
+
1. <ins>Let |isTrusted| be `true`.</ins>
1757
+
1. <ins>If |bodyArg| is not a {{TrustedScript}} object, set |isTrusted| to `false`.</ins>
1758
+
1. <ins>If |isTrusted| is `true` then:
1759
+
1. <ins>If |bodyString| is not equal to |bodyArg|'s `[[Data]]` internal slot, set |isTrusted| to `false`.</ins>
1760
+
1. <ins>If |isTrusted| is `true`, then:</ins>
1761
+
1. <ins> For each |arg| in |parameterArgs|:</ins>
1762
+
1. <ins>Let |index| be the index of |arg| in |parameterArgs|.</ins>
1763
+
1. <ins>If |arg| is not a {{TrustedScript}} object, set |isTrusted| to `false`.</ins>
1764
+
1. <ins>If |isTrusted| is `true`, then:</ins>
1765
+
1. <ins>if |parameterStrings|[|index|] is not equal to |arg|'s `[[Data]]` internal slot, set |isTrusted| to `false`.</ins>
1766
+
1. <ins>If |isTrusted| is `true`, let |sourceToValidate| be a new instance of
1756
1767
the {{TrustedScript}} interface, with its `[[Data]]` internal slot value
1757
1768
set to |source|. Otherwise, let |sourceToValidate| be |source|.</ins>
1758
1769
1759
-
1. <ins>Let |compilationSink| be `"Function"` if |compilationType| is `*FUNCTION*`, otherwise `"Eval"`.</ins>
1760
1770
1. <ins>Let |sourceString| be the result of executing the
1761
1771
[$Get Trusted Type compliant string$] algorithm, with:
0 commit comments