Skip to content

Commit

Permalink
Editorial: Eliminate monkey-patching from "The [[IsHTMLDDA]] Internal…
Browse files Browse the repository at this point in the history
… Slot"
  • Loading branch information
jmdyck committed Apr 13, 2023
1 parent b32086c commit 1b314ab
Showing 1 changed file with 16 additions and 32 deletions.
48 changes: 16 additions & 32 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -4806,7 +4806,7 @@ <h1>
</emu-clause>
</emu-clause>

<emu-clause id="sec-toboolean" oldids="table-toboolean-conversions" type="abstract operation">
<emu-clause id="sec-toboolean" oldids="table-toboolean-conversions,sec-IsHTMLDDA-internal-slot-to-boolean" type="abstract operation">
<h1>
ToBoolean (
_argument_: an ECMAScript language value,
Expand All @@ -4819,7 +4819,8 @@ <h1>
<emu-alg>
1. If _argument_ is a Boolean, return _argument_.
1. If _argument_ is one of *undefined*, *null*, *+0*<sub>𝔽</sub>, *-0*<sub>𝔽</sub>, *NaN*, *0*<sub>ℤ</sub>, or the empty String, return *false*.
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>.
1. [id="step-to-boolean-web-compat-insertion-point", normative-optional] If the host is a web browser or otherwise supports <emu-xref href="#sec-IsHTMLDDA-internal-slot" title></emu-xref>, then
1. If _argument_ is an Object and _argument_ has an [[IsHTMLDDA]] internal slot, return *false*.
1. Return *true*.
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -5944,7 +5945,7 @@ <h1>
</emu-note>
</emu-clause>

<emu-clause id="sec-islooselyequal" type="abstract operation" oldids="sec-abstract-equality-comparison">
<emu-clause id="sec-islooselyequal" type="abstract operation" oldids="sec-abstract-equality-comparison,sec-IsHTMLDDA-internal-slot-aec">
<h1>
IsLooselyEqual (
_x_: an ECMAScript language value,
Expand All @@ -5960,7 +5961,9 @@ <h1>
1. Return IsStrictlyEqual(_x_, _y_).
1. If _x_ is *null* and _y_ is *undefined*, return *true*.
1. If _x_ is *undefined* and _y_ is *null*, return *true*.
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>.
1. [id="step-abstract-equality-comparison-web-compat-insertion-point", normative-optional] If the host is a web browser or otherwise supports <emu-xref href="#sec-IsHTMLDDA-internal-slot" title></emu-xref>, then
1. If _x_ is an Object, _x_ has an [[IsHTMLDDA]] internal slot, and _y_ is either *undefined* or *null*, return *true*.
1. If _x_ is either *undefined* or *null*, _y_ is an Object, and _y_ has an [[IsHTMLDDA]] internal slot, return *true*.
1. If _x_ is a Number and _y_ is a String, return ! IsLooselyEqual(_x_, ! ToNumber(_y_)).
1. If _x_ is a String and _y_ is a Number, return ! IsLooselyEqual(! ToNumber(_x_), _y_).
1. If _x_ is a BigInt and _y_ is a String, then
Expand Down Expand Up @@ -19639,7 +19642,7 @@ <h1>Runtime Semantics: Evaluation</h1>
<emu-clause id="sec-typeof-operator">
<h1>The `typeof` Operator</h1>

<emu-clause id="sec-typeof-operator-runtime-semantics-evaluation" oldids="table-typeof-operator-results" type="sdo">
<emu-clause id="sec-typeof-operator-runtime-semantics-evaluation" oldids="table-typeof-operator-results,sec-IsHTMLDDA-internal-slot-typeof" type="sdo">
<h1>Runtime Semantics: Evaluation</h1>
<emu-grammar>UnaryExpression : `typeof` UnaryExpression</emu-grammar>
<emu-alg>
Expand All @@ -19655,7 +19658,8 @@ <h1>Runtime Semantics: Evaluation</h1>
1. If _val_ is a Number, return *"number"*.
1. If _val_ is a BigInt, return *"bigint"*.
1. Assert: _val_ is an Object.
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>.
1. [id="step-typeof-web-compat-insertion-point", normative-optional] If the host is a web browser or otherwise supports <emu-xref href="#sec-IsHTMLDDA-internal-slot" title></emu-xref>, then
1. If _val_ has an [[IsHTMLDDA]] internal slot, return *"undefined"*.
1. If _val_ has a [[Call]] internal slot, return *"function"*.
1. Return *"object"*.
</emu-alg>
Expand Down Expand Up @@ -48540,32 +48544,12 @@ <h1>The [[IsHTMLDDA]] Internal Slot</h1>
<emu-note>
<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>
</emu-note>

<emu-annex id="sec-IsHTMLDDA-internal-slot-to-boolean">
<h1>Changes to ToBoolean</h1>
<p>The following step replaces step <emu-xref href="#step-to-boolean-web-compat-insertion-point"></emu-xref> of ToBoolean:</p>
<emu-alg replaces-step="step-to-boolean-web-compat-insertion-point">
1. If _argument_ is an Object and _argument_ has an [[IsHTMLDDA]] internal slot, return *false*.
</emu-alg>
</emu-annex>

<emu-annex id="sec-IsHTMLDDA-internal-slot-aec">
<h1>Changes to IsLooselyEqual</h1>
<p>The following steps replace step <emu-xref href="#step-abstract-equality-comparison-web-compat-insertion-point"></emu-xref> of IsLooselyEqual:</p>
<emu-alg replaces-step="step-abstract-equality-comparison-web-compat-insertion-point">
1. Perform the following steps:
1. If _x_ is an Object, _x_ has an [[IsHTMLDDA]] internal slot, and _y_ is either *undefined* or *null*, return *true*.
1. If _x_ is either *undefined* or *null*, _y_ is an Object, and _y_ has an [[IsHTMLDDA]] internal slot, return *true*.
</emu-alg>
</emu-annex>

<emu-annex id="sec-IsHTMLDDA-internal-slot-typeof">
<h1>Changes to the `typeof` Operator</h1>
<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>
<emu-alg replaces-step="step-typeof-web-compat-insertion-point">
1. If _val_ has an [[IsHTMLDDA]] internal slot, return *"undefined"*.
</emu-alg>
</emu-annex>
<p>This feature involves special semantics at the following points:</p>
<ul>
<li>step <emu-xref href="#step-to-boolean-web-compat-insertion-point"></emu-xref> in ToBoolean</li>
<li>step <emu-xref href="#step-abstract-equality-comparison-web-compat-insertion-point"></emu-xref> in IsLooselyEqual</li>
<li>step <emu-xref href="#step-typeof-web-compat-insertion-point"></emu-xref> in the evaluation semantics for `typeof`</li>
</ul>
</emu-annex>

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

0 comments on commit 1b314ab

Please sign in to comment.