|
1355 | 1355 | });
|
1356 | 1356 |
|
1357 | 1357 | let sdoMap = JSON.parse(`{}`);
|
1358 |
| -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 & Software License","number":"A"}]}`); |
| 1358 | +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 & Software License","number":"A"}]}`); |
1359 | 1359 | ;let usesMultipage = false</script><style>body {
|
1360 | 1360 | display: flex;
|
1361 | 1361 | word-wrap: break-word;
|
|
2628 | 2628 | </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">
|
2629 | 2629 | <title>Menu</title>
|
2630 | 2630 | <path stroke-width="10" stroke-linecap="round" d="M30,60 h60 M30,30 m0,5 h60 M30,90 m0,-5 h60"></path>
|
2631 |
| - </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 & Software License"><span class="secnum">A</span> Copyright & 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> |
| 2631 | + </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 & Software License"><span class="secnum">A</span> Copyright & 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> |
2632 | 2632 |
|
2633 | 2633 | <emu-clause id="sec-scope">
|
2634 | 2634 | <h1><span class="secnum">1</span> Scope</h1>
|
@@ -2676,9 +2676,9 @@ <h1><span class="secnum">4</span> Group By Helpers</h1>
|
2676 | 2676 |
|
2677 | 2677 | <ins class="block">
|
2678 | 2678 | <emu-clause id="sec-group-by" type="abstract operation" aoid="GroupBy">
|
2679 |
| - <h1><span class="secnum">4.1</span> GroupBy ( <var>items</var>, <var>callbackfn</var>, <var>coercion</var> )</h1> |
2680 |
| - <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> |
2681 |
| - <emu-alg><ol><li>Perform ? 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 ? 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 ? IteratorClose(<var>iteratorRecord</var>, <var>error</var>).</li></ol></li><li>Let <var>next</var> be ? 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 ? 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> |
| 2679 | + <h1><span class="secnum">4.1</span> GroupBy ( <var>items</var>, <var>callbackfn</var>, <var>keyCoercion</var> )</h1> |
| 2680 | + <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> |
| 2681 | + <emu-alg><ol><li>Perform ? 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 ? 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 ? IteratorClose(<var>iteratorRecord</var>, <var>error</var>).</li></ol></li><li>Let <var>next</var> be ? 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 ? 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> |
2682 | 2682 | </emu-clause>
|
2683 | 2683 | </ins>
|
2684 | 2684 |
|
|
0 commit comments