Skip to content

Commit

Permalink
Editorial: Convert the preambles of the SortCompare operations
Browse files Browse the repository at this point in the history
... to the 'standard' form introduced in PR tc39#1914.
  • Loading branch information
jmdyck committed Apr 18, 2020
1 parent 2206edd commit 6155722
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 @@ -34361,7 +34361,7 @@ <h1>Array.prototype.sort ( _comparefn_ )</h1>

<emu-clause id="sec-sortcompare" aoid="SortCompare">
<h1>Runtime Semantics: SortCompare ( _x_, _y_ )</h1>
<p>The SortCompare abstract operation is called with two arguments _x_ and _y_. It also has access to the _comparefn_ argument passed to the current invocation of the `sort` method. The following steps are taken:</p>
<p>The abstract operation SortCompare takes arguments _x_ and _y_. It also has access to the _comparefn_ argument passed to the current invocation of the `sort` method. It performs the following steps when called:</p>
<emu-alg>
1. If _x_ and _y_ are both *undefined*, return *+0*.
1. If _x_ is *undefined*, return 1.
Expand Down Expand Up @@ -35524,8 +35524,8 @@ <h1>%TypedArray%.prototype.sort ( _comparefn_ )</h1>
1. Let _len_ be _obj_.[[ArrayLength]].
</emu-alg>
<p>The implementation-defined sort order condition for exotic objects is not applied by %TypedArray%`.prototype.sort`.</p>
<p>The following version of SortCompare is used by %TypedArray%`.prototype.sort`. It performs a numeric comparison rather than the string comparison used in <emu-xref href="#sec-array.prototype.sort"></emu-xref>. SortCompare has access to the _comparefn_ and _buffer_ values of the current invocation of the `sort` method.</p>
<p>When the TypedArray SortCompare abstract operation is called with two arguments _x_ and _y_, the following steps are taken:</p>
<p>The following version of SortCompare is used by %TypedArray%`.prototype.sort`. It performs a numeric comparison rather than the string comparison used in <emu-xref href="#sec-array.prototype.sort"></emu-xref>.</p>
<p>The abstract operation TypedArraySortCompare takes arguments _x_ and _y_. It also has access to the _comparefn_ and _buffer_ values of the current invocation of the `sort` method. It performs the following steps when called:</p>
<emu-alg>
1. Assert: Both Type(_x_) and Type(_y_) are Number or both are BigInt.
1. If _comparefn_ is not *undefined*, then
Expand Down

0 comments on commit 6155722

Please sign in to comment.