Skip to content

Commit 219640b

Browse files
committed
Editorial: Eliminate monkey-patching from "The [[IsHTMLDDA]] Internal Slot"
1 parent 61fce18 commit 219640b

File tree

1 file changed

+16
-32
lines changed

1 file changed

+16
-32
lines changed

spec.html

+16-32
Original file line numberDiff line numberDiff line change
@@ -4847,7 +4847,7 @@ <h1>
48474847
</emu-clause>
48484848
</emu-clause>
48494849

4850-
<emu-clause id="sec-toboolean" oldids="table-toboolean-conversions" type="abstract operation">
4850+
<emu-clause id="sec-toboolean" oldids="table-toboolean-conversions,sec-IsHTMLDDA-internal-slot-to-boolean" type="abstract operation">
48514851
<h1>
48524852
ToBoolean (
48534853
_argument_: an ECMAScript language value,
@@ -4860,7 +4860,8 @@ <h1>
48604860
<emu-alg>
48614861
1. If _argument_ is a Boolean, return _argument_.
48624862
1. If _argument_ is any of *undefined*, *null*, *+0*<sub>𝔽</sub>, *-0*<sub>𝔽</sub>, *NaN*, *0*<sub>ℤ</sub>, or the empty String, return *false*.
4863-
1. [id="step-to-boolean-web-compat-insertion-point"] NOTE: This step is replaced in section <emu-xref href="#sec-IsHTMLDDA-internal-slot-to-boolean"></emu-xref>.
4863+
1. [id="step-to-boolean-web-compat-insertion-point"] If <ins normative-optional>the host supports <emu-xref href="#sec-IsHTMLDDA-internal-slot" title></emu-xref></ins>, then
4864+
1. If _argument_ is an Object and _argument_ has an [[IsHTMLDDA]] internal slot, return *false*.
48644865
1. Return *true*.
48654866
</emu-alg>
48664867
</emu-clause>
@@ -5983,7 +5984,7 @@ <h1>
59835984
</emu-note>
59845985
</emu-clause>
59855986

5986-
<emu-clause id="sec-islooselyequal" type="abstract operation" oldids="sec-abstract-equality-comparison">
5987+
<emu-clause id="sec-islooselyequal" type="abstract operation" oldids="sec-abstract-equality-comparison,sec-IsHTMLDDA-internal-slot-aec">
59875988
<h1>
59885989
IsLooselyEqual (
59895990
_x_: an ECMAScript language value,
@@ -5999,7 +6000,9 @@ <h1>
59996000
1. Return IsStrictlyEqual(_x_, _y_).
60006001
1. If _x_ is *null* and _y_ is *undefined*, return *true*.
60016002
1. If _x_ is *undefined* and _y_ is *null*, return *true*.
6002-
1. [id="step-abstract-equality-comparison-web-compat-insertion-point"] NOTE: This step is replaced in section <emu-xref href="#sec-IsHTMLDDA-internal-slot-aec"></emu-xref>.
6003+
1. [id="step-abstract-equality-comparison-web-compat-insertion-point"] If <ins normative-optional>the host supports <emu-xref href="#sec-IsHTMLDDA-internal-slot" title></emu-xref></ins>, then
6004+
1. If _x_ is an Object, _x_ has an [[IsHTMLDDA]] internal slot, and _y_ is either *null* or *undefined*, return *true*.
6005+
1. If _x_ is either *null* or *undefined*, _y_ is an Object, and _y_ has an [[IsHTMLDDA]] internal slot, return *true*.
60036006
1. If _x_ is a Number and _y_ is a String, return ! IsLooselyEqual(_x_, ! ToNumber(_y_)).
60046007
1. If _x_ is a String and _y_ is a Number, return ! IsLooselyEqual(! ToNumber(_x_), _y_).
60056008
1. If _x_ is a BigInt and _y_ is a String, then
@@ -19580,7 +19583,7 @@ <h1>Runtime Semantics: Evaluation</h1>
1958019583
<emu-clause id="sec-typeof-operator">
1958119584
<h1>The `typeof` Operator</h1>
1958219585

19583-
<emu-clause id="sec-typeof-operator-runtime-semantics-evaluation" oldids="table-typeof-operator-results" type="sdo">
19586+
<emu-clause id="sec-typeof-operator-runtime-semantics-evaluation" oldids="table-typeof-operator-results,sec-IsHTMLDDA-internal-slot-typeof" type="sdo">
1958419587
<h1>Runtime Semantics: Evaluation</h1>
1958519588
<emu-grammar>UnaryExpression : `typeof` UnaryExpression</emu-grammar>
1958619589
<emu-alg>
@@ -19596,7 +19599,8 @@ <h1>Runtime Semantics: Evaluation</h1>
1959619599
1. If _val_ is a Number, return *"number"*.
1959719600
1. If _val_ is a BigInt, return *"bigint"*.
1959819601
1. Assert: _val_ is an Object.
19599-
1. [id="step-typeof-web-compat-insertion-point"] NOTE: This step is replaced in section <emu-xref href="#sec-IsHTMLDDA-internal-slot-typeof"></emu-xref>.
19602+
1. [id="step-typeof-web-compat-insertion-point"] If <ins normative-optional>the host supports <emu-xref href="#sec-IsHTMLDDA-internal-slot" title></emu-xref></ins>, then
19603+
1. If _val_ has an [[IsHTMLDDA]] internal slot, return *"undefined"*.
1960019604
1. If _val_ has a [[Call]] internal slot, return *"function"*.
1960119605
1. Return *"object"*.
1960219606
</emu-alg>
@@ -48041,32 +48045,12 @@ <h1>The [[IsHTMLDDA]] Internal Slot</h1>
4804148045
<emu-note>
4804248046
<p>Objects with an [[IsHTMLDDA]] internal slot are never created by this specification. However, the <a href="https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-all"><code>document.all</code> object</a> in web browsers is a host-defined exotic object with this slot that exists for web compatibility purposes. There are no other known examples of this type of object and implementations should not create any with the exception of `document.all`.</p>
4804348047
</emu-note>
48044-
48045-
<emu-annex id="sec-IsHTMLDDA-internal-slot-to-boolean">
48046-
<h1>Changes to ToBoolean</h1>
48047-
<p>The following step replaces step <emu-xref href="#step-to-boolean-web-compat-insertion-point"></emu-xref> of ToBoolean:</p>
48048-
<emu-alg replaces-step="step-to-boolean-web-compat-insertion-point">
48049-
1. If _argument_ is an Object and _argument_ has an [[IsHTMLDDA]] internal slot, return *false*.
48050-
</emu-alg>
48051-
</emu-annex>
48052-
48053-
<emu-annex id="sec-IsHTMLDDA-internal-slot-aec">
48054-
<h1>Changes to IsLooselyEqual</h1>
48055-
<p>The following steps replace step <emu-xref href="#step-abstract-equality-comparison-web-compat-insertion-point"></emu-xref> of IsLooselyEqual:</p>
48056-
<emu-alg replaces-step="step-abstract-equality-comparison-web-compat-insertion-point">
48057-
1. Perform the following steps:
48058-
1. If _x_ is an Object, _x_ has an [[IsHTMLDDA]] internal slot, and _y_ is either *null* or *undefined*, return *true*.
48059-
1. If _x_ is either *null* or *undefined*, _y_ is an Object, and _y_ has an [[IsHTMLDDA]] internal slot, return *true*.
48060-
</emu-alg>
48061-
</emu-annex>
48062-
48063-
<emu-annex id="sec-IsHTMLDDA-internal-slot-typeof">
48064-
<h1>Changes to the `typeof` Operator</h1>
48065-
<p>The following step replaces step <emu-xref href="#step-typeof-web-compat-insertion-point"></emu-xref> of <emu-xref href="#sec-typeof-operator-runtime-semantics-evaluation">the evaluation semantics for `typeof`</emu-xref>:</p>
48066-
<emu-alg replaces-step="step-typeof-web-compat-insertion-point">
48067-
1. If _val_ has an [[IsHTMLDDA]] internal slot, return *"undefined"*.
48068-
</emu-alg>
48069-
</emu-annex>
48048+
<p>This feature involves special semantics at the following points:</p>
48049+
<ul>
48050+
<li>step <emu-xref href="#step-to-boolean-web-compat-insertion-point"></emu-xref> in ToBoolean</li>
48051+
<li>step <emu-xref href="#step-abstract-equality-comparison-web-compat-insertion-point"></emu-xref> in IsLooselyEqual</li>
48052+
<li>step <emu-xref href="#step-typeof-web-compat-insertion-point"></emu-xref> in the evaluation semantics for `typeof`</li>
48053+
</ul>
4807048054
</emu-annex>
4807148055

4807248056
<emu-annex id="sec-web-compat-host-make-job-callback">

0 commit comments

Comments
 (0)