Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
* Fix how we refer to exceptions.

+ For `Decimal128.prototype.round`, use `mark` to mark an
incomplete algorithm.

+ Use `*this* value` rather than `**this** value`.
  • Loading branch information
jessealama committed May 15, 2024
1 parent b215d8e commit 2e6d33c
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions spec.emu
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ location: https://github.com/tc39/proposal-decimal/
1. If _argument_ is a BigInt, set _toParse_ to BigInt::toString(_argument_, 10).
1. If _argument_ is a Number, set _toParse_ to Number::toString(_argument_, 10).
1. If _argument_ is a String, set _toParse_ to _argument_.
1. If _toParse_ is not a String, throw a *TypeError*.
1. If _toParse_ is not a String, throw a *TypeError* exception.
1. Return <mark>« 42, 42 »</mark>.
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -251,7 +251,7 @@ location: https://github.com/tc39/proposal-decimal/
<h1>Decimal128.prototype.neg ( )</h1>
<p>This method performs the following steps when called:</p>
<emu-alg>
1. Let _O_ be the **this** value.
1. Let _O_ be the *this* value.
1. Perform ? RequireInternalSlot(_O_, [[Decimal128Data]]).
1. Let _d_ be _O_.[[Decimal128Data]].
1. If _d_ is *NaN*<sub>𝔻</sub>, return Decimal128ValueToObject(*NaN*<sub>𝔻</sub>).
Expand All @@ -269,7 +269,7 @@ location: https://github.com/tc39/proposal-decimal/
<h1>Decimal128.prototype.add ( _x_ )</h1>
<p>This method performs the following steps when called:</p>
<emu-alg>
1. Let _O_ be the **this** value.
1. Let _O_ be the *this* value.
1. Perform ? RequireInternalSlot(_O_, [[Decimal128Data]]).
1. Perform ? RequireInternalSlot(_x_, [[Decimal128Data]]).
1. Let _d1_ be _O_.[[Decimal128Data]].
Expand All @@ -290,7 +290,7 @@ location: https://github.com/tc39/proposal-decimal/
<h1>Decimal128.prototype.subtract ( _x_ )</h1>
<p>This method performs the following steps when called:</p>
<emu-alg>
1. Let _O_ be the **this** value.
1. Let _O_ be the *this* value.
1. Perform ? RequireInternalSlot(_O_, [[Decimal128Data]]).
1. Perform ? RequireInternalSlot(_x_, [[Decimal128Data]]).
1. Let _d1_ be _O_.[[Decimal128Data]].
Expand All @@ -311,7 +311,7 @@ location: https://github.com/tc39/proposal-decimal/
<h1>Decimal128.prototype.multiply ( _x_ )</h1>
<p>This method performs the following steps when called:</p>
<emu-alg>
1. Let _O_ be the **this** value.
1. Let _O_ be the *this* value.
1. Perform ? RequireInternalSlot(_O_, [[Decimal128Data]]).
1. Perform ? RequireInternalSlot(_x_, [[Decimal128Data]]).
1. Let _d1_ be _O_.[[Decimal128Data]].
Expand All @@ -335,7 +335,7 @@ location: https://github.com/tc39/proposal-decimal/
<h1>Decimal128.prototype.divide ( _x_ )</h1>
<p>This method performs the following steps when called:</p>
<emu-alg>
1. Let _O_ be the **this** value.
1. Let _O_ be the *this* value.
1. Perform ? RequireInternalSlot(_O_, [[Decimal128Data]]).
1. Perform ? RequireInternalSlot(_x_, [[Decimal128Data]]).
1. Let _d1_ be _O_.[[Decimal128Data]].
Expand All @@ -350,7 +350,7 @@ location: https://github.com/tc39/proposal-decimal/
<h1>Decimal128.prototype.remainder ( _x_ )</h1>
<p>This method performs the following steps when called:</p>
<emu-alg>
1. Let _O_ be the **this** value.
1. Let _O_ be the *this* value.
1. Perform ? RequireInternalSlot(_O_, [[Decimal128Data]]).
1. Perform ? RequireInternalSlot(_x_, [[Decimal128Data]]).
1. Let _d1_ be _O_.[[Decimal128Data]].
Expand All @@ -368,7 +368,7 @@ location: https://github.com/tc39/proposal-decimal/
<h1>Decimal128.prototype.equals ( _x_ )</h1>
<p>This method performs the following steps when called:</p>
<emu-alg>
1. Let _O_ be the **this** value.
1. Let _O_ be the *this* value.
1. Perform ? RequireInternalSlot(_O_, [[Decimal128Data]]).
1. Perform ? RequireInternalSlot(_x_, [[Decimal128Data]]).
1. Let _d1_ be _O_.[[Decimal128Data]].
Expand All @@ -389,7 +389,7 @@ location: https://github.com/tc39/proposal-decimal/
<h1>Decimal128.prototype.lessThan ( _x_ )</h1>
<p>This method performs the following steps when called:</p>
<emu-alg>
1. Let _O_ be the **this** value.
1. Let _O_ be the *this* value.
1. Perform ? RequireInternalSlot(_O_, [[Decimal128Data]]).
1. Perform ? RequireInternalSlot(_x_, [[Decimal128Data]]).
1. Let _d1_ be _O_.[[Decimal128Data]].
Expand All @@ -410,7 +410,7 @@ location: https://github.com/tc39/proposal-decimal/
<h1>Decimal128.prototype.compare ( _x_ )</h1>
<p>This method performs the following steps when called:</p>
<emu-alg>
1. Let _O_ be the **this** value.
1. Let _O_ be the *this* value.
1. Perform ? RequireInternalSlot(_O_, [[Decimal128Data]]).
1. Perform ? RequireInternalSlot(_x_, [[Decimal128Data]]).
1. Let _d1_ be _O_.[[Decimal128Data]].
Expand Down Expand Up @@ -443,7 +443,7 @@ location: https://github.com/tc39/proposal-decimal/
<h1>Decimal128.prototype.round ( _numFractionalDigits_ [ , _mode_ ] )</h1>
<p>This method performs the following steps when called:</p>
<emu-alg>
1. Return Decimal128ValueToObject(*NaN*<sub>𝔻</sub>).
1. <mark>Return Decimal128ValueToObject(*NaN*<sub>𝔻</sub>)</mark>.
</emu-alg>
<emu-note>
<p>If _mode_ is neither *undefined* nor a String, throw a *TypeError* exception.</p>
Expand All @@ -454,10 +454,10 @@ location: https://github.com/tc39/proposal-decimal/
<h1>Decimal128.prototype.toString ( [ _options_ ] )</h1>
<p>This method performs the following steps when called:</p>
<emu-alg>
1. Let _roundingMode_ be ? Get(_options_, [[roundingMode]]).
1. Let _roundingMode_ be ? Get(_options_, *"roundingMode"*).
1. If _roundingMode_ is *undefined*, set _roundingMode_ to *"roundTiesToEven"*.
1. If _roundingMode_ is not a <emu-xref href="#dfn-decimal128-rounding-mode">rounding mode</emu-xref>, throw a *RangeError* exception.
1. Let _format_ be ? Get(_options_, [[format]]).
1. Let _format_ be ? Get(_options_, *"format*").
1. If _format_ is *undefined*, set _format_ to *"decimal"*.
1. If _format_ is not in « *"decimal"*, *"exponential"* », then throw a *RangeError* exception.
1. If _format_ is *"decimal*", then
Expand All @@ -469,7 +469,7 @@ location: https://github.com/tc39/proposal-decimal/
<h1>Decimal128.prototype.toBigInt ( )</h1>
<p>This method performs the following steps when called:</p>
<emu-alg>
1. If IsIntegralDecimal128(*this*) is *false*, throw a RangeError.
1. If IsIntegralDecimal128(*this*) is *false*, throw a *RangeError* exception.
1. Return ! ToBigInt(Call (*this*.[[toString]], *this*)).
</emu-alg>
</emu-clause>
Expand Down

0 comments on commit 2e6d33c

Please sign in to comment.