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
<p>The abstract operation IsLooselyEqual takes arguments _x_ (an ECMAScript language value) and _y_ (an ECMAScript language value). It provides the semantics for the comparison _x_ == _y_, returning *true* or *false*. It performs the following steps when called:</p>
5291
5291
<emu-alg>
5292
5292
1. If Type(_x_) is the same as Type(_y_), then
5293
5293
1. Return the result of performing Strict Equality Comparison _x_ === _y_.
5294
5294
1. If _x_ is *null* and _y_ is *undefined*, return *true*.
5295
5295
1. If _x_ is *undefined* and _y_ is *null*, return *true*.
5296
5296
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>.
5297
-
1. If Type(_x_) is Number and Type(_y_) is String, return the result of the comparison _x_ == ! ToNumber(_y_).
5298
-
1. If Type(_x_) is String and Type(_y_) is Number, return the result of the comparison ! ToNumber(_x_) == _y_.
5297
+
1. If Type(_x_) is Number and Type(_y_) is String, return IsLooselyEqual(_x_, ! ToNumber(_y_)).
5298
+
1. If Type(_x_) is String and Type(_y_) is Number, return IsLooselyEqual(! ToNumber(_x_), _y_).
5299
5299
1. If Type(_x_) is BigInt and Type(_y_) is String, then
5300
5300
1. Let _n_ be ! StringToBigInt(_y_).
5301
5301
1. If _n_ is *NaN*, return *false*.
5302
-
1. Return the result of the comparison _x_ == _n_.
5303
-
1. If Type(_x_) is String and Type(_y_) is BigInt, return the result of the comparison _y_ == _x_.
5304
-
1. If Type(_x_) is Boolean, return the result of the comparison ! ToNumber(_x_) == _y_.
5305
-
1. If Type(_y_) is Boolean, return the result of the comparison _x_ == ! ToNumber(_y_).
5306
-
1. If Type(_x_) is either String, Number, BigInt, or Symbol and Type(_y_) is Object, return the result of the comparison _x_ == ? ToPrimitive(_y_).
5307
-
1. If Type(_x_) is Object and Type(_y_) is either String, Number, BigInt, or Symbol, return the result of the comparison ? ToPrimitive(_x_) == _y_.
5302
+
1. Return IsLooselyEqual(_x_, _n_).
5303
+
1. If Type(_x_) is String and Type(_y_) is BigInt, return IsLooselyEqual(_y_, _x_).
5304
+
1. If Type(_x_) is Boolean, return IsLooselyEqual(! ToNumber(_x_), _y_).
5305
+
1. If Type(_y_) is Boolean, return IsLooselyEqual(_x_, ! ToNumber(_y_)).
5306
+
1. If Type(_x_) is either String, Number, BigInt, or Symbol and Type(_y_) is Object, return IsLooselyEqual(_x_, ? ToPrimitive(_y_)).
5307
+
1. If Type(_x_) is Object and Type(_y_) is either String, Number, BigInt, or Symbol, return IsLooselyEqual(? ToPrimitive(_x_), _y_).
5308
5308
1. If Type(_x_) is BigInt and Type(_y_) is Number, or if Type(_x_) is Number and Type(_y_) is BigInt, then
5309
5309
1. If _x_ or _y_ are any of *NaN*, *+∞*<sub>𝔽</sub>, or *-∞*<sub>𝔽</sub>, return *false*.
5310
5310
1. If ℝ(_x_) = ℝ(_y_), return *true*; otherwise return *false*.
@@ -42987,7 +42986,7 @@ <h1>Initializers in ForIn Statement Heads</h1>
42987
42986
42988
42987
<emu-annex id="sec-IsHTMLDDA-internal-slot">
42989
42988
<h1>The [[IsHTMLDDA]] Internal Slot</h1>
42990
-
<p>An <dfn>[[IsHTMLDDA]] internal slot</dfn> may exist on host-defined objects. Objects with an [[IsHTMLDDA]] internal slot behave like *undefined* in the <emu-xref href="#sec-toboolean">ToBoolean</emu-xref> and <emu-xref href="#sec-abstract-equality-comparison">Abstract Equality Comparison</emu-xref> abstract operations and when used as an operand for the <emu-xref href="#sec-typeof-operator">`typeof` operator</emu-xref>.</p>
42989
+
<p>An <dfn>[[IsHTMLDDA]] internal slot</dfn> may exist on host-defined objects. Objects with an [[IsHTMLDDA]] internal slot behave like *undefined* in the <emu-xref href="#sec-toboolean">ToBoolean</emu-xref> and IsLooselyEqual abstract operations and when used as an operand for the <emu-xref href="#sec-typeof-operator">`typeof` operator</emu-xref>.</p>
42991
42990
<emu-note>
42992
42991
<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>
42993
42992
</emu-note>
@@ -43002,8 +43001,8 @@ <h1>Changes to ToBoolean</h1>
43002
43001
</emu-annex>
43003
43002
43004
43003
<emu-annex id="sec-IsHTMLDDA-internal-slot-aec">
43005
-
<h1>Changes to Abstract Equality Comparison</h1>
43006
-
<p>The following steps replace step <emu-xref href="#step-abstract-equality-comparison-web-compat-insertion-point"></emu-xref> of the <emu-xref href="#sec-abstract-equality-comparison">Abstract Equality Comparison</emu-xref> algorithm:</p>
43004
+
<h1>Changes to IsLooselyEqual</h1>
43005
+
<p>The following steps replace step <emu-xref href="#step-abstract-equality-comparison-web-compat-insertion-point"></emu-xref> of the IsLooselyEqual algorithm:</p>
43007
43006
<emu-alg>
43008
43007
1. If Type(_x_) is Object and _x_ has an [[IsHTMLDDA]] internal slot and _y_ is either *null* or *undefined*, return *true*.
43009
43008
1. If _x_ is either *null* or *undefined* and Type(_y_) is Object and _y_ has an [[IsHTMLDDA]] internal slot, return *true*.
0 commit comments