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 Oct 31, 2022
1 parent cfbd519 commit 13a9463
Showing 1 changed file with 19 additions and 39 deletions.
58 changes: 19 additions & 39 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -4847,7 +4847,7 @@ <h1>
</emu-clause>
</emu-clause>

<emu-clause id="sec-toboolean" type="abstract operation">
<emu-clause id="sec-toboolean" type="abstract operation" oldids="sec-IsHTMLDDA-internal-slot-to-boolean">
<h1>
ToBoolean (
_argument_: an ECMAScript language value,
Expand Down Expand Up @@ -4928,10 +4928,11 @@ <h1>
Object
</td>
<td>
Return *true*.
<emu-note>
<p>An alternate algorithm related to the [[IsHTMLDDA]] internal slot is mandated in section <emu-xref href="#sec-IsHTMLDDA-internal-slot-to-boolean"></emu-xref>.</p>
</emu-note>
<emu-alg>
1. [id="step-toboolean-object"] If <ins normative-optional>the host supports <emu-xref href="#sec-IsHTMLDDA-internal-slot" title></emu-xref></ins>, then
1. If _argument_ has an [[IsHTMLDDA]] internal slot, return *false*.
1. Return *true*.
</emu-alg>
</td>
</tr>
</table>
Expand Down Expand Up @@ -6191,7 +6192,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 @@ -6207,7 +6208,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"] If <ins normative-optional>the host supports <emu-xref href="#sec-IsHTMLDDA-internal-slot" title></emu-xref></ins>, then
1. If _x_ is an Object, _x_ has an [[IsHTMLDDA]] internal slot, and _y_ is either *null* or *undefined*, return *true*.
1. If _x_ is either *null* or *undefined*, _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 @@ -19788,15 +19791,16 @@ <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" type="sdo">
<emu-clause id="sec-typeof-operator-runtime-semantics-evaluation" type="sdo" oldids="sec-IsHTMLDDA-internal-slot-typeof">
<h1>Runtime Semantics: Evaluation</h1>
<emu-grammar>UnaryExpression : `typeof` UnaryExpression</emu-grammar>
<emu-alg>
1. Let _val_ be ? Evaluation of |UnaryExpression|.
1. If _val_ is a Reference Record, then
1. If IsUnresolvableReference(_val_) is *true*, return *"undefined"*.
1. Set _val_ to ? GetValue(_val_).
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"] If <ins normative-optional>the host supports <emu-xref href="#sec-IsHTMLDDA-internal-slot" title></emu-xref></ins>, then
1. If _val_ is an Object and _val_ has an [[IsHTMLDDA]] internal slot, return *"undefined"*.
1. Return a String according to <emu-xref href="#table-typeof-operator-results"></emu-xref>.
</emu-alg>
<emu-table id="table-typeof-operator-results" caption="typeof Operator Results" oldids="table-35">
Expand Down Expand Up @@ -19883,9 +19887,6 @@ <h1>Runtime Semantics: Evaluation</h1>
</tr>
</table>
</emu-table>
<emu-note>
<p>An additional entry related to [[IsHTMLDDA]] Internal Slot can be found in <emu-xref href="#sec-IsHTMLDDA-internal-slot-typeof"></emu-xref>.</p>
</emu-note>
</emu-clause>
</emu-clause>

Expand Down Expand Up @@ -48332,33 +48333,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 result column in <emu-xref href="#table-toboolean-conversions"></emu-xref> for an argument type of Object is replaced with the following algorithm:</p>
<emu-alg>
1. If _argument_ has an [[IsHTMLDDA]] internal slot, return *false*.
1. Return *true*.
</emu-alg>
</emu-annex>

<emu-annex id="sec-IsHTMLDDA-internal-slot-aec">
<h1>Changes to IsLooselyEqual</h1>
<p>During IsLooselyEqual the following steps are performed in place of step <emu-xref href="#step-abstract-equality-comparison-web-compat-insertion-point"></emu-xref>:</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 *null* or *undefined*, return *true*.
1. If _x_ is either *null* or *undefined*, _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_ is an Object and _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-toboolean-object"></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 13a9463

Please sign in to comment.