Skip to content

Commit

Permalink
Editorial: Better align GroupBy keyCoercion with CanonicalizeKeyedCol…
Browse files Browse the repository at this point in the history
…lectionKey (tc39#3343)
  • Loading branch information
gibson042 authored and ljharb committed Jun 5, 2024
1 parent a78d504 commit 623e2c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -6785,7 +6785,7 @@ <h1>
GroupBy (
_items_: an ECMAScript language value,
_callbackfn_: an ECMAScript language value,
_keyCoercion_: ~property~ or ~zero~,
_keyCoercion_: ~property~ or ~collection~,
): either a normal completion containing a List of Records with fields [[Key]] (an ECMAScript language value) and [[Elements]] (a List of ECMAScript language values), or a throw completion
</h1>
<dl class="header">
Expand All @@ -6810,7 +6810,7 @@ <h1>
1. Set _key_ to Completion(ToPropertyKey(_key_)).
1. IfAbruptCloseIterator(_key_, _iteratorRecord_).
1. Else,
1. Assert: _keyCoercion_ is ~zero~.
1. Assert: _keyCoercion_ is ~collection~.
1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_).
1. Perform AddValueToKeyedGroup(_groups_, _key_, _value_).
1. Set _k_ to _k_ + 1.
Expand Down Expand Up @@ -41743,7 +41743,7 @@ <h1>Map.groupBy ( _items_, _callbackfn_ )</h1>
</emu-note>
<p>This function performs the following steps when called:</p>
<emu-alg>
1. Let _groups_ be ? GroupBy(_items_, _callbackfn_, ~zero~).
1. Let _groups_ be ? GroupBy(_items_, _callbackfn_, ~collection~).
1. Let _map_ be ! Construct(%Map%).
1. For each Record { [[Key]], [[Elements]] } _g_ of _groups_, do
1. Let _elements_ be CreateArrayFromList(_g_.[[Elements]]).
Expand Down

0 comments on commit 623e2c8

Please sign in to comment.