From a62e077e6ff013ae43e5fb20cf7186203ae70651 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Wed, 27 Oct 2021 11:23:50 -0700 Subject: [PATCH 1/2] groupByMap should have SameValueZero semantics --- spec.emu | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec.emu b/spec.emu index ddaa932..be6b4e7 100644 --- a/spec.emu +++ b/spec.emu @@ -86,14 +86,14 @@ location: https://tc39.es/proposal-array-grouping/ 1. Repeat, while _k_ < _len_ 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Let _propertyKey_ be ? ToPropertyKey(? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). + 1. Let _key_ be ? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). 1. Let _group_ be ~empty~. 1. For each Record { [[Key]], [[Elements]] } _g_ of _groups_, do - 1. If ! SameValueNonNumeric(_g_.[[Key]], _propertyKey_) is *true*, then + 1. If ! SameValueZero(_g_.[[Key]], _key_) is *true*, then 1. Set _group_ to _g_. 1. If _group_ is ~empty~, then 1. Let _elements_ be a new empty List. - 1. Set _group_ to the Record { [[Key]]: _propertyKey_, [[Elements]]: _elements_ }. + 1. Set _group_ to the Record { [[Key]]: _key_, [[Elements]]: _elements_ }. 1. Append _group_ as the last element of _groups_. 1. Append _kValue_ as the last element of _group_.[[Elements]]. 1. Set _k_ to _k_ + 1. From 08273c2742973b8e7676acfeaa459e0aa4ba3eb0 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Wed, 27 Oct 2021 11:25:53 -0700 Subject: [PATCH 2/2] convert to -0 to +0 --- spec.emu | 1 + 1 file changed, 1 insertion(+) diff --git a/spec.emu b/spec.emu index be6b4e7..debf78d 100644 --- a/spec.emu +++ b/spec.emu @@ -87,6 +87,7 @@ location: https://tc39.es/proposal-array-grouping/ 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be ? Get(_O_, _Pk_). 1. Let _key_ be ? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). + 1. If _key_ is *-0*𝔽, set _key_ to *+0*𝔽. 1. Let _group_ be ~empty~. 1. For each Record { [[Key]], [[Elements]] } _g_ of _groups_, do 1. If ! SameValueZero(_g_.[[Key]], _key_) is *true*, then