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

Commit

Permalink
[spec] rename param, per #54 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jun 20, 2023
1 parent e4e6b13 commit 90c5724
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions index.html
Expand Up @@ -1355,7 +1355,7 @@
});
let sdoMap = JSON.parse(`{}`);
let biblio = JSON.parse(`{"refsByClause":{"sec-object.groupby":["_ref_0"],"sec-map.groupby":["_ref_1"],"sec-group-by":["_ref_2"]},"entries":[{"type":"clause","id":"sec-scope","titleHTML":"Scope","number":"1"},{"type":"clause","id":"sec-object.groupby","title":"Object.groupBy ( items, callbackfn )","titleHTML":"Object.groupBy ( <var>items</var>, <var>callbackfn</var> )","number":"2.1"},{"type":"clause","id":"sec-properties-of-the-object-constructor","titleHTML":"Properties of the Object Constructor (20.1.2)","number":"2"},{"type":"clause","id":"sec-map.groupby","title":"Map.groupBy ( items, callbackfn )","titleHTML":"Map.groupBy ( <var>items</var>, <var>callbackfn</var> )","number":"3.1"},{"type":"clause","id":"sec-properties-of-the-map-constructor","titleHTML":"Properties of the Map Constructor (24.1.2)","number":"3"},{"type":"op","aoid":"GroupBy","refId":"sec-group-by"},{"type":"clause","id":"sec-group-by","title":"GroupBy ( items, callbackfn, coercion )","titleHTML":"GroupBy ( <var>items</var>, <var>callbackfn</var>, <var>coercion</var> )","number":"4.1","referencingIds":["_ref_0","_ref_1"]},{"type":"op","aoid":"AddValueToKeyedGroup","refId":"sec-add-value-to-keyed-group"},{"type":"clause","id":"sec-add-value-to-keyed-group","title":"AddValueToKeyedGroup ( groups, key, value )","titleHTML":"AddValueToKeyedGroup ( <var>groups</var>, <var>key</var>, <var>value</var> )","number":"4.2","referencingIds":["_ref_2"]},{"type":"clause","id":"sec-group-by-helpers","titleHTML":"Group By Helpers","number":"4"},{"type":"clause","id":"sec-copyright-and-software-license","title":"Copyright & Software License","titleHTML":"Copyright &amp; Software License","number":"A"}]}`);
let biblio = JSON.parse(`{"refsByClause":{"sec-object.groupby":["_ref_0"],"sec-map.groupby":["_ref_1"],"sec-group-by":["_ref_2"]},"entries":[{"type":"clause","id":"sec-scope","titleHTML":"Scope","number":"1"},{"type":"clause","id":"sec-object.groupby","title":"Object.groupBy ( items, callbackfn )","titleHTML":"Object.groupBy ( <var>items</var>, <var>callbackfn</var> )","number":"2.1"},{"type":"clause","id":"sec-properties-of-the-object-constructor","titleHTML":"Properties of the Object Constructor (20.1.2)","number":"2"},{"type":"clause","id":"sec-map.groupby","title":"Map.groupBy ( items, callbackfn )","titleHTML":"Map.groupBy ( <var>items</var>, <var>callbackfn</var> )","number":"3.1"},{"type":"clause","id":"sec-properties-of-the-map-constructor","titleHTML":"Properties of the Map Constructor (24.1.2)","number":"3"},{"type":"op","aoid":"GroupBy","refId":"sec-group-by"},{"type":"clause","id":"sec-group-by","title":"GroupBy ( items, callbackfn, keyCoercion )","titleHTML":"GroupBy ( <var>items</var>, <var>callbackfn</var>, <var>keyCoercion</var> )","number":"4.1","referencingIds":["_ref_0","_ref_1"]},{"type":"op","aoid":"AddValueToKeyedGroup","refId":"sec-add-value-to-keyed-group"},{"type":"clause","id":"sec-add-value-to-keyed-group","title":"AddValueToKeyedGroup ( groups, key, value )","titleHTML":"AddValueToKeyedGroup ( <var>groups</var>, <var>key</var>, <var>value</var> )","number":"4.2","referencingIds":["_ref_2"]},{"type":"clause","id":"sec-group-by-helpers","titleHTML":"Group By Helpers","number":"4"},{"type":"clause","id":"sec-copyright-and-software-license","title":"Copyright & Software License","titleHTML":"Copyright &amp; Software License","number":"A"}]}`);
;let usesMultipage = false</script><style>body {
display: flex;
word-wrap: break-word;
Expand Down Expand Up @@ -2628,7 +2628,7 @@
</ul></div><div id="menu-toggle"><svg xmlns="http://www.w3.org/2000/svg" style="width:100%; height:100%; stroke:currentColor" viewBox="0 0 120 120">
<title>Menu</title>
<path stroke-width="10" stroke-linecap="round" d="M30,60 h60 M30,30 m0,5 h60 M30,90 m0,-5 h60"></path>
</svg></div><div id="menu-spacer" class="menu-spacer"></div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-pins"><div class="menu-pane-header">Pins</div><ul id="menu-pins-list"></ul></div><div class="menu-pane-header">Table of Contents</div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-scope" title="Scope"><span class="secnum">1</span> Scope</a></li><li><span class="item-toggle">◢</span><a href="#sec-properties-of-the-object-constructor" title="Properties of the Object Constructor (20.1.2)"><span class="secnum">2</span> Properties of the Object Constructor (20.1.2)</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-object.groupby" title="Object.groupBy ( items, callbackfn )"><span class="secnum">2.1</span> Object.groupBy ( <var>items</var>, <var>callbackfn</var> )</a></li></ol></li><li><span class="item-toggle">◢</span><a href="#sec-properties-of-the-map-constructor" title="Properties of the Map Constructor (24.1.2)"><span class="secnum">3</span> Properties of the Map Constructor (24.1.2)</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-map.groupby" title="Map.groupBy ( items, callbackfn )"><span class="secnum">3.1</span> Map.groupBy ( <var>items</var>, <var>callbackfn</var> )</a></li></ol></li><li><span class="item-toggle">◢</span><a href="#sec-group-by-helpers" title="Group By Helpers"><span class="secnum">4</span> Group By Helpers</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-group-by" title="GroupBy ( items, callbackfn, coercion )"><span class="secnum">4.1</span> GroupBy ( <var>items</var>, <var>callbackfn</var>, <var>coercion</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-add-value-to-keyed-group" title="AddValueToKeyedGroup ( groups, key, value )"><span class="secnum">4.2</span> AddValueToKeyedGroup ( <var>groups</var>, <var>key</var>, <var>value</var> )</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-copyright-and-software-license" title="Copyright &amp; Software License"><span class="secnum">A</span> Copyright &amp; Software License</a></li></ol></div></div><div id="spec-container"><h1 class="version">Stage 2 Draft / May 31, 2023</h1><h1 class="title">Array Grouping</h1>
</svg></div><div id="menu-spacer" class="menu-spacer"></div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-pins"><div class="menu-pane-header">Pins</div><ul id="menu-pins-list"></ul></div><div class="menu-pane-header">Table of Contents</div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-scope" title="Scope"><span class="secnum">1</span> Scope</a></li><li><span class="item-toggle">◢</span><a href="#sec-properties-of-the-object-constructor" title="Properties of the Object Constructor (20.1.2)"><span class="secnum">2</span> Properties of the Object Constructor (20.1.2)</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-object.groupby" title="Object.groupBy ( items, callbackfn )"><span class="secnum">2.1</span> Object.groupBy ( <var>items</var>, <var>callbackfn</var> )</a></li></ol></li><li><span class="item-toggle">◢</span><a href="#sec-properties-of-the-map-constructor" title="Properties of the Map Constructor (24.1.2)"><span class="secnum">3</span> Properties of the Map Constructor (24.1.2)</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-map.groupby" title="Map.groupBy ( items, callbackfn )"><span class="secnum">3.1</span> Map.groupBy ( <var>items</var>, <var>callbackfn</var> )</a></li></ol></li><li><span class="item-toggle">◢</span><a href="#sec-group-by-helpers" title="Group By Helpers"><span class="secnum">4</span> Group By Helpers</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-group-by" title="GroupBy ( items, callbackfn, keyCoercion )"><span class="secnum">4.1</span> GroupBy ( <var>items</var>, <var>callbackfn</var>, <var>keyCoercion</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-add-value-to-keyed-group" title="AddValueToKeyedGroup ( groups, key, value )"><span class="secnum">4.2</span> AddValueToKeyedGroup ( <var>groups</var>, <var>key</var>, <var>value</var> )</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-copyright-and-software-license" title="Copyright &amp; Software License"><span class="secnum">A</span> Copyright &amp; Software License</a></li></ol></div></div><div id="spec-container"><h1 class="version">Stage 2 Draft / June 20, 2023</h1><h1 class="title">Array Grouping</h1>
<emu-clause id="sec-scope">
<h1><span class="secnum">1</span> Scope</h1>
Expand Down Expand Up @@ -2676,9 +2676,9 @@ <h1><span class="secnum">4</span> Group By Helpers</h1>
<ins class="block">
<emu-clause id="sec-group-by" type="abstract operation" aoid="GroupBy">
<h1><span class="secnum">4.1</span> GroupBy ( <var>items</var>, <var>callbackfn</var>, <var>coercion</var> )</h1>
<p>The abstract operation GroupBy takes arguments <var>items</var> (an ECMAScript language value), <var>callbackfn</var> (an ECMAScript language value), and <var>coercion</var> (<emu-const>property</emu-const> or <emu-const>zero</emu-const>) and returns either a normal completion containing a List of Records with fields <var class="field">[[Key]]</var> (an ECMAScript language value) and <var class="field">[[Elements]]</var> (a List of ECMAScript language values), or a throw completion. It performs the following steps when called:</p>
<emu-alg><ol><li>Perform ?&nbsp;RequireObjectCoercible(<var>items</var>).</li><li>If IsCallable(<var>callbackfn</var>) is <emu-val>false</emu-val>, throw a <emu-val>TypeError</emu-val> exception.</li><li>Let <var>groups</var> be a new empty List.</li><li>Let <var>iteratorRecord</var> be ?&nbsp;GetIterator(<var>items</var>).</li><li>Let <var>k</var> be 0.</li><li>Repeat,<ol><li>If <var>k</var> ≥ 2<sup>53</sup> - 1, then<ol><li>Let <var>error</var> be ThrowCompletion(a newly created <emu-val>TypeError</emu-val> object).</li><li>Return ?&nbsp;IteratorClose(<var>iteratorRecord</var>, <var>error</var>).</li></ol></li><li>Let <var>next</var> be ?&nbsp;IteratorStep(<var>iteratorRecord</var>).</li><li>If <var>next</var> is <emu-val>false</emu-val>, then<ol><li>Return <var>groups</var>.</li></ol></li><li>Let <var>value</var> be ?&nbsp;IteratorValue(<var>next</var>).</li><li>Let <var>key</var> be Completion(Call(<var>callbackfn</var>, <emu-val>undefined</emu-val>, « <var>value</var>, 𝔽(<var>k</var>) »)).</li><li>IfAbruptCloseIterator(<var>key</var>, <var>iteratorRecord</var>).</li><li>If <var>coercion</var> is <emu-const>property</emu-const>, then<ol><li>Set <var>key</var> to Completion(ToPropertyKey(<var>key</var>)).</li><li>IfAbruptCloseIterator(<var>key</var>, <var>iteratorRecord</var>).</li></ol></li><li>Else,<ol><li>Assert: <var>coercion</var> is <emu-const>zero</emu-const>.</li><li>If <var>key</var> is <emu-val>-0</emu-val><sub>𝔽</sub>, set <var>key</var> to <emu-val>+0</emu-val><sub>𝔽</sub>.</li></ol></li><li>Perform <emu-xref aoid="AddValueToKeyedGroup" id="_ref_2"><a href="#sec-add-value-to-keyed-group">AddValueToKeyedGroup</a></emu-xref>(<var>groups</var>, <var>key</var>, <var>value</var>).</li><li>Set <var>k</var> to <var>k</var> + 1.</li></ol></li></ol></emu-alg>
<h1><span class="secnum">4.1</span> GroupBy ( <var>items</var>, <var>callbackfn</var>, <var>keyCoercion</var> )</h1>
<p>The abstract operation GroupBy takes arguments <var>items</var> (an ECMAScript language value), <var>callbackfn</var> (an ECMAScript language value), and <var>keyCoercion</var> (<emu-const>property</emu-const> or <emu-const>zero</emu-const>) and returns either a normal completion containing a List of Records with fields <var class="field">[[Key]]</var> (an ECMAScript language value) and <var class="field">[[Elements]]</var> (a List of ECMAScript language values), or a throw completion. It performs the following steps when called:</p>
<emu-alg><ol><li>Perform ?&nbsp;RequireObjectCoercible(<var>items</var>).</li><li>If IsCallable(<var>callbackfn</var>) is <emu-val>false</emu-val>, throw a <emu-val>TypeError</emu-val> exception.</li><li>Let <var>groups</var> be a new empty List.</li><li>Let <var>iteratorRecord</var> be ?&nbsp;GetIterator(<var>items</var>).</li><li>Let <var>k</var> be 0.</li><li>Repeat,<ol><li>If <var>k</var> ≥ 2<sup>53</sup> - 1, then<ol><li>Let <var>error</var> be ThrowCompletion(a newly created <emu-val>TypeError</emu-val> object).</li><li>Return ?&nbsp;IteratorClose(<var>iteratorRecord</var>, <var>error</var>).</li></ol></li><li>Let <var>next</var> be ?&nbsp;IteratorStep(<var>iteratorRecord</var>).</li><li>If <var>next</var> is <emu-val>false</emu-val>, then<ol><li>Return <var>groups</var>.</li></ol></li><li>Let <var>value</var> be ?&nbsp;IteratorValue(<var>next</var>).</li><li>Let <var>key</var> be Completion(Call(<var>callbackfn</var>, <emu-val>undefined</emu-val>, « <var>value</var>, 𝔽(<var>k</var>) »)).</li><li>IfAbruptCloseIterator(<var>key</var>, <var>iteratorRecord</var>).</li><li>If <var>keyCoercion</var> is <emu-const>property</emu-const>, then<ol><li>Set <var>key</var> to Completion(ToPropertyKey(<var>key</var>)).</li><li>IfAbruptCloseIterator(<var>key</var>, <var>iteratorRecord</var>).</li></ol></li><li>Else,<ol><li>Assert: <var>keyCoercion</var> is <emu-const>zero</emu-const>.</li><li>If <var>key</var> is <emu-val>-0</emu-val><sub>𝔽</sub>, set <var>key</var> to <emu-val>+0</emu-val><sub>𝔽</sub>.</li></ol></li><li>Perform <emu-xref aoid="AddValueToKeyedGroup" id="_ref_2"><a href="#sec-add-value-to-keyed-group">AddValueToKeyedGroup</a></emu-xref>(<var>groups</var>, <var>key</var>, <var>value</var>).</li><li>Set <var>k</var> to <var>k</var> + 1.</li></ol></li></ol></emu-alg>
</emu-clause>
</ins>
Expand Down
6 changes: 3 additions & 3 deletions spec.emu
Expand Up @@ -76,7 +76,7 @@ location: https://tc39.es/proposal-array-grouping/
GroupBy (
_items_: an ECMAScript language value,
_callbackfn_: an ECMAScript language value,
_coercion_: ~property~ or ~zero~,
_keyCoercion_: ~property~ or ~zero~,
): 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 @@ -97,11 +97,11 @@ location: https://tc39.es/proposal-array-grouping/
1. Let _value_ be ? IteratorValue(_next_).
1. Let _key_ be Completion(Call(_callbackfn_, *undefined*, &laquo; _value_, 𝔽(_k_) &raquo;)).
1. IfAbruptCloseIterator(_key_, _iteratorRecord_).
1. If _coercion_ is ~property~, then
1. If _keyCoercion_ is ~property~, then
1. Set _key_ to Completion(ToPropertyKey(_key_)).
1. IfAbruptCloseIterator(_key_, _iteratorRecord_).
1. Else,
1. Assert: _coercion_ is ~zero~.
1. Assert: _keyCoercion_ is ~zero~.
1. If _key_ is *-0*<sub>𝔽</sub>, set _key_ to *+0*<sub>𝔽</sub>.
1. Perform AddValueToKeyedGroup(_groups_, _key_, _value_).
1. Set _k_ to _k_ + 1.
Expand Down

0 comments on commit 90c5724

Please sign in to comment.