Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 11b15cb

Browse files
authored
groupByMap should have SameValueZero semantics (#18)
* groupByMap should have SameValueZero semantics * convert to -0 to +0
1 parent c2af54d commit 11b15cb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spec.emu

+4-3
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,15 @@ location: https://tc39.es/proposal-array-grouping/
8686
1. Repeat, while _k_ < _len_
8787
1. Let _Pk_ be ! ToString(𝔽(_k_)).
8888
1. Let _kValue_ be ? Get(_O_, _Pk_).
89-
1. Let _propertyKey_ be ? ToPropertyKey(? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)).
89+
1. Let _key_ be ? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »).
90+
1. If _key_ is *-0*<sub>𝔽</sub>, set _key_ to *+0*<sub>𝔽</sub>.
9091
1. Let _group_ be ~empty~.
9192
1. For each Record { [[Key]], [[Elements]] } _g_ of _groups_, do
92-
1. If ! SameValueNonNumeric(_g_.[[Key]], _propertyKey_) is *true*, then
93+
1. If ! SameValueZero(_g_.[[Key]], _key_) is *true*, then
9394
1. Set _group_ to _g_.
9495
1. If _group_ is ~empty~, then
9596
1. Let _elements_ be a new empty List.
96-
1. Set _group_ to the Record { [[Key]]: _propertyKey_, [[Elements]]: _elements_ }.
97+
1. Set _group_ to the Record { [[Key]]: _key_, [[Elements]]: _elements_ }.
9798
1. Append _group_ as the last element of _groups_.
9899
1. Append _kValue_ as the last element of _group_.[[Elements]].
99100
1. Set _k_ to _k_ + 1.

0 commit comments

Comments
 (0)