Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: Convert more abstract operation preambles #1953

Merged
merged 1 commit into from
Apr 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,7 @@ <h1>Number::bitwiseOR ( _x_, _y_ )</h1>

<emu-clause id="sec-numeric-types-number-tostring" aoid="Number::toString" oldids="sec-tostring-applied-to-the-number-type">
<h1>Number::toString ( _x_ )</h1>
<p>The abstract operation Number::toString converts a Number _x_ to String format as follows:</p>
<p>The abstract operation Number::toString takes argument _x_ (a Number). It converts _x_ to String format. It performs the following steps when called:</p>
<emu-alg>
1. If _x_ is *NaN*, return the String *"NaN"*.
1. If _x_ is *+0* or *-0*, return the String *"0"*.
Expand Down Expand Up @@ -1860,7 +1860,7 @@ <h1>BigInt::unaryMinus ( _x_ )</h1>

<emu-clause id="sec-numeric-types-bigint-bitwiseNOT">
<h1>BigInt::bitwiseNOT ( _x_ )</h1>
<p>The abstract operation BigInt::bitwiseNOT with an argument _x_ of type BigInt returns the one's complement of _x_; that is, -_x_ - 1.</p>
<p>The abstract operation BigInt::bitwiseNOT takes argument _x_ (a BigInt). It returns the one's complement of _x_; that is, -_x_ - 1.</p>
</emu-clause>

<emu-clause id="sec-numeric-types-bigint-exponentiate">
Expand All @@ -1874,7 +1874,7 @@ <h1>BigInt::exponentiate ( _base_, _exponent_ )</h1>

<emu-clause id="sec-numeric-types-bigint-multiply">
<h1>BigInt::multiply ( _x_, _y_ )</h1>
<p>The abstract operation BigInt::multiply with two arguments _x_ and _y_ of type BigInt returns the BigInt value that represents the result of multiplying _x_ and _y_.</p>
<p>The abstract operation BigInt::multiply takes arguments _x_ (a BigInt) and _y_ (a BigInt). It returns the BigInt value that represents the result of multiplying _x_ and _y_.</p>
<emu-note>Even if the result has a much larger bit width than the input, the exact mathematical answer is given.</emu-note>
</emu-clause>

Expand All @@ -1900,17 +1900,17 @@ <h1>BigInt::remainder ( _n_, _d_ )</h1>

<emu-clause id="sec-numeric-types-bigint-add">
<h1>BigInt::add ( _x_, _y_ )</h1>
<p>The abstract operation BigInt::add with two arguments _x_ and _y_ of type BigInt returns the BigInt value that represents the sum of _x_ and _y_.</p>
<p>The abstract operation BigInt::add takes arguments _x_ (a BigInt) and _y_ (a BigInt). It returns the BigInt value that represents the sum of _x_ and _y_.</p>
</emu-clause>

<emu-clause id="sec-numeric-types-bigint-subtract">
<h1>BigInt::subtract ( _x_, _y_ )</h1>
<p>The abstract operation BigInt::subtract with two arguments _x_ and _y_ of type BigInt returns the BigInt value that represents the difference _x_ minus _y_.</p>
<p>The abstract operation BigInt::subtract takes arguments _x_ (a BigInt) and _y_ (a BigInt). It returns the BigInt value that represents the difference _x_ minus _y_.</p>
</emu-clause>

<emu-clause id="sec-numeric-types-bigint-leftShift">
<h1>BigInt::leftShift ( _x_, _y_ )</h1>
<p>The abstract operation BigInt::leftShift with two arguments _x_ and _y_ of type BigInt performs the following steps:</p>
<p>The abstract operation BigInt::leftShift takes arguments _x_ (a BigInt) and _y_ (a BigInt). It performs the following steps when called:</p>
<emu-alg>
1. If _y_ &lt; *0n*, then
1. Return the BigInt value that represents _x_ &divide; 2<sup>-_y_</sup>, rounding down to the nearest integer, including for negative numbers.
Expand All @@ -1921,41 +1921,41 @@ <h1>BigInt::leftShift ( _x_, _y_ )</h1>

<emu-clause id="sec-numeric-types-bigint-signedRightShift">
<h1>BigInt::signedRightShift ( _x_, _y_ )</h1>
<p>The abstract operation BigInt::signedRightShift with arguments _x_ and _y_ of type BigInt performs the following steps:</p>
<p>The abstract operation BigInt::signedRightShift takes arguments _x_ (a BigInt) and _y_ (a BigInt). It performs the following steps when called:</p>
<emu-alg>
1. Return BigInt::leftShift(_x_, -_y_).
</emu-alg>
</emu-clause>

<emu-clause id="sec-numeric-types-bigint-unsignedRightShift">
<h1>BigInt::unsignedRightShift ( _x_, _y_ )</h1>
<p>The abstract operation BigInt::unsignedRightShift with two arguments _x_ and _y_ of type BigInt performs the following steps:</p>
<p>The abstract operation BigInt::unsignedRightShift takes arguments _x_ (a BigInt) and _y_ (a BigInt). It performs the following steps when called:</p>
<emu-alg>
1. Throw a *TypeError* exception.
</emu-alg>
</emu-clause>

<emu-clause id="sec-numeric-types-bigint-lessThan">
<h1>BigInt::lessThan ( _x_, _y_ )</h1>
<p>The abstract operation BigInt::lessThan with two arguments _x_ and _y_ of type BigInt returns *true* if _x_ is less than _y_ and *false* otherwise.</p>
<p>The abstract operation BigInt::lessThan takes arguments _x_ (a BigInt) and _y_ (a BigInt). It returns *true* if _x_ is less than _y_ and *false* otherwise.</p>
</emu-clause>

<emu-clause id="sec-numeric-types-bigint-equal">
<h1>BigInt::equal ( _x_, _y_ )</h1>
<p>The abstract operation BigInt::equal with two arguments _x_ and _y_ of type BigInt returns *true* if _x_ and _y_ have the same mathematical integer value and *false* otherwise.</p>
<p>The abstract operation BigInt::equal takes arguments _x_ (a BigInt) and _y_ (a BigInt). It returns *true* if _x_ and _y_ have the same mathematical integer value and *false* otherwise.</p>
</emu-clause>

<emu-clause id="sec-numeric-types-bigint-sameValue">
<h1>BigInt::sameValue ( _x_, _y_ )</h1>
<p>The abstract operation BigInt::sameValue with two arguments _x_ and _y_ of type BigInt performs the following steps:</p>
<p>The abstract operation BigInt::sameValue takes arguments _x_ (a BigInt) and _y_ (a BigInt). It performs the following steps when called:</p>
<emu-alg>
1. Return BigInt::equal(_x_, _y_).
</emu-alg>
</emu-clause>

<emu-clause id="sec-numeric-types-bigint-sameValueZero">
<h1>BigInt::sameValueZero ( _x_, _y_ )</h1>
<p>The abstract operation BigInt::sameValueZero with two arguments _x_ and _y_ of type BigInt performs the following steps:</p>
<p>The abstract operation BigInt::sameValueZero takes arguments _x_ (a BigInt) and _y_ (a BigInt). It performs the following steps when called:</p>
<emu-alg>
1. Return BigInt::equal(_x_, _y_).
</emu-alg>
Expand Down Expand Up @@ -2048,7 +2048,7 @@ <h1>BigInt::bitwiseOR ( _x_, _y_ )</h1>

<emu-clause id="sec-numeric-types-bigint-tostring" aoid="BigInt::toString">
<h1>BigInt::toString ( _x_ )</h1>
<p>The abstract operation BigInt::toString converts a BigInt _x_ to String format as follows:</p>
<p>The abstract operation BigInt::toString takes argument _x_ (a BigInt). It converts _x_ to String format. It performs the following steps when called:</p>
<emu-alg>
1. If _x_ is less than zero, return the string-concatenation of the String *"-"* and ! BigInt::toString(-_x_).
1. Return the String value consisting of the code units of the digits of the decimal representation of _x_.
Expand Down Expand Up @@ -34373,7 +34373,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 @@ -35536,8 +35536,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