@@ -6811,7 +6811,7 @@ <h1>
6811
6811
1. IfAbruptCloseIterator(_key_, _iteratorRecord_).
6812
6812
1. Else,
6813
6813
1. Assert: _keyCoercion_ is ~zero~.
6814
- 1. If _key_ is *-0*<sub>𝔽</sub>, set _key_ to *+0*<sub>𝔽</sub> .
6814
+ 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_) .
6815
6815
1. Perform AddValueToKeyedGroup(_groups_, _key_, _value_).
6816
6816
1. Set _k_ to _k_ + 1.
6817
6817
</emu-alg>
@@ -41809,8 +41809,9 @@ <h1>Map.prototype.delete ( _key_ )</h1>
41809
41809
<emu-alg>
41810
41810
1. Let _M_ be the *this* value.
41811
41811
1. Perform ? RequireInternalSlot(_M_, [[MapData]]).
41812
+ 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_).
41812
41813
1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do
41813
- 1. If _p_.[[Key]] is not ~empty~ and SameValueZero( _p_.[[Key]], _key_) is *true* , then
41814
+ 1. If _p_.[[Key]] is not ~empty~ and _p_.[[Key]] is _key_ , then
41814
41815
1. Set _p_.[[Key]] to ~empty~.
41815
41816
1. Set _p_.[[Value]] to ~empty~.
41816
41817
1. Return *true*.
@@ -41863,8 +41864,9 @@ <h1>Map.prototype.get ( _key_ )</h1>
41863
41864
<emu-alg>
41864
41865
1. Let _M_ be the *this* value.
41865
41866
1. Perform ? RequireInternalSlot(_M_, [[MapData]]).
41867
+ 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_).
41866
41868
1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do
41867
- 1. If _p_.[[Key]] is not ~empty~ and SameValueZero( _p_.[[Key]], _key_) is *true* , return _p_.[[Value]].
41869
+ 1. If _p_.[[Key]] is not ~empty~ and _p_.[[Key]] is _key_ , return _p_.[[Value]].
41868
41870
1. Return *undefined*.
41869
41871
</emu-alg>
41870
41872
</emu-clause>
@@ -41875,8 +41877,9 @@ <h1>Map.prototype.has ( _key_ )</h1>
41875
41877
<emu-alg>
41876
41878
1. Let _M_ be the *this* value.
41877
41879
1. Perform ? RequireInternalSlot(_M_, [[MapData]]).
41880
+ 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_).
41878
41881
1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do
41879
- 1. If _p_.[[Key]] is not ~empty~ and SameValueZero( _p_.[[Key]], _key_) is *true* , return *true*.
41882
+ 1. If _p_.[[Key]] is not ~empty~ and _p_.[[Key]] is _key_ , return *true*.
41880
41883
1. Return *false*.
41881
41884
</emu-alg>
41882
41885
</emu-clause>
@@ -41896,11 +41899,11 @@ <h1>Map.prototype.set ( _key_, _value_ )</h1>
41896
41899
<emu-alg>
41897
41900
1. Let _M_ be the *this* value.
41898
41901
1. Perform ? RequireInternalSlot(_M_, [[MapData]]).
41902
+ 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_).
41899
41903
1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do
41900
- 1. If _p_.[[Key]] is not ~empty~ and SameValueZero( _p_.[[Key]], _key_) is *true* , then
41904
+ 1. If _p_.[[Key]] is not ~empty~ and _p_.[[Key]] is _key_ , then
41901
41905
1. Set _p_.[[Value]] to _value_.
41902
41906
1. Return _M_.
41903
- 1. If _key_ is *-0*<sub>𝔽</sub>, set _key_ to *+0*<sub>𝔽</sub>.
41904
41907
1. Let _p_ be the Record { [[Key]]: _key_, [[Value]]: _value_ }.
41905
41908
1. Append _p_ to _M_.[[MapData]].
41906
41909
1. Return _M_.
@@ -42091,10 +42094,10 @@ <h1>Set.prototype.add ( _value_ )</h1>
42091
42094
<emu-alg>
42092
42095
1. Let _S_ be the *this* value.
42093
42096
1. Perform ? RequireInternalSlot(_S_, [[SetData]]).
42097
+ 1. Set _value_ to CanonicalizeKeyedCollectionKey(_value_).
42094
42098
1. For each element _e_ of _S_.[[SetData]], do
42095
- 1. If _e_ is not ~empty~ and SameValueZero( _e_, _value_) is *true* , then
42099
+ 1. If _e_ is not ~empty~ and _e_ is _value_ , then
42096
42100
1. Return _S_.
42097
- 1. If _value_ is *-0*<sub>𝔽</sub>, set _value_ to *+0*<sub>𝔽</sub>.
42098
42101
1. Append _value_ to _S_.[[SetData]].
42099
42102
1. Return _S_.
42100
42103
</emu-alg>
@@ -42126,8 +42129,9 @@ <h1>Set.prototype.delete ( _value_ )</h1>
42126
42129
<emu-alg>
42127
42130
1. Let _S_ be the *this* value.
42128
42131
1. Perform ? RequireInternalSlot(_S_, [[SetData]]).
42132
+ 1. Set _value_ to CanonicalizeKeyedCollectionKey(_value_).
42129
42133
1. For each element _e_ of _S_.[[SetData]], do
42130
- 1. If _e_ is not ~empty~ and SameValueZero( _e_, _value_) is *true* , then
42134
+ 1. If _e_ is not ~empty~ and _e_ is _value_ , then
42131
42135
1. Replace the element of _S_.[[SetData]] whose value is _e_ with an element whose value is ~empty~.
42132
42136
1. Return *true*.
42133
42137
1. Return *false*.
@@ -42184,8 +42188,9 @@ <h1>Set.prototype.has ( _value_ )</h1>
42184
42188
<emu-alg>
42185
42189
1. Let _S_ be the *this* value.
42186
42190
1. Perform ? RequireInternalSlot(_S_, [[SetData]]).
42191
+ 1. Set _value_ to CanonicalizeKeyedCollectionKey(_value_).
42187
42192
1. For each element _e_ of _S_.[[SetData]], do
42188
- 1. If _e_ is not ~empty~ and SameValueZero( _e_, _value_) is *true* , return *true*.
42193
+ 1. If _e_ is not ~empty~ and _e_ is _value_ , return *true*.
42189
42194
1. Return *false*.
42190
42195
</emu-alg>
42191
42196
</emu-clause>
@@ -42574,6 +42579,24 @@ <h1>Properties of WeakSet Instances</h1>
42574
42579
<p>WeakSet instances are ordinary objects that inherit properties from the WeakSet prototype. WeakSet instances also have a [[WeakSetData]] internal slot.</p>
42575
42580
</emu-clause>
42576
42581
</emu-clause>
42582
+
42583
+ <emu-clause id="sec-abstract-operations-for-keyed-collections">
42584
+ <h1>Abstract Operations for Keyed Collections</h1>
42585
+
42586
+ <emu-clause id="sec-canonicalizekeyedcollectionkey" type="abstract operation">
42587
+ <h1>
42588
+ CanonicalizeKeyedCollectionKey (
42589
+ _key_: an ECMAScript language value,
42590
+ ): an ECMAScript language value
42591
+ </h1>
42592
+ <dl class="header">
42593
+ </dl>
42594
+ <emu-alg>
42595
+ 1. If _key_ is *-0*<sub>𝔽</sub>, return *+0*<sub>𝔽</sub>.
42596
+ 1. Return _key_.
42597
+ </emu-alg>
42598
+ </emu-clause>
42599
+ </emu-clause>
42577
42600
</emu-clause>
42578
42601
42579
42602
<emu-clause id="sec-structured-data">
0 commit comments