Skip to content

Commit

Permalink
Editorial: use "is 0" instead of "is zero" for consistency (#1086)
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Oct 16, 2019
1 parent d4e4f44 commit 5f84cd9
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -1924,31 +1924,31 @@ <h1>BigInt::sameValueZero ( _x_, _y_ )</h1>
<emu-clause id="sec-binaryand" aoid="BinaryAnd">
<h1>BinaryAnd ( _x_, _y_ )</h1>
<emu-alg>
1. Assert: _x_ is 0 or 1.
1. Assert: _y_ is 0 or 1.
1. If _x_ is 1 and _y_ is 1, return 1.
1. Else, return 0.
1. Assert: _x_ is *0n* or *1n*.
1. Assert: _y_ is *0n* or *1n*.
1. If _x_ is *1n* and _y_ is *1n*, return *1n*.
1. Else, return *0n*.
</emu-alg>
</emu-clause>

<emu-clause id="sec-binaryor" aoid="BinaryOr">
<h1>BinaryOr ( _x_, _y_ )</h1>
<emu-alg>
1. Assert: _x_ is 0 or 1.
1. Assert: _y_ is 0 or 1.
1. If _x_ is 1 or _y_ is 1, return 1.
1. Else, return 0.
1. Assert: _x_ is *0n* or *1n*.
1. Assert: _y_ is *0n* or *1n*.
1. If _x_ is *1n* or _y_ is *1n*, return *1n*.
1. Else, return *0n*.
</emu-alg>
</emu-clause>

<emu-clause id="sec-binaryxor" aoid="BinaryXor">
<h1>BinaryXor ( _x_, _y_ )</h1>
<emu-alg>
1. Assert: _x_ is 0 or 1.
1. Assert: _y_ is 0 or 1.
1. If _x_ is 1 and _y_ is 0, return 1.
1. Else if _x_ is 0 and _y_ is 1, return 1.
1. Else, return 0.
1. Assert: _x_ is *0n* or *1n*.
1. Assert: _y_ is *0n* or *1n*.
1. If _x_ is *1n* and _y_ is *0n*, return *1n*.
1. Else if _x_ is *0n* and _y_ is *1n*, return *1n*.
1. Else, return *0n*.
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -4515,7 +4515,7 @@ <h1>ToBoolean ( _argument_ )</h1>
String
</td>
<td>
If _argument_ is the empty String (its length is zero), return *false*; otherwise return *true*.
If _argument_ is the empty String (its length is *+0*), return *false*; otherwise return *true*.
</td>
</tr>
<tr>
Expand Down Expand Up @@ -27439,7 +27439,7 @@ <h1>Math.clz32 ( _x_ )</h1>
1. Return _p_.
</emu-alg>
<emu-note>
<p>If _n_ is 0, _p_ will be 32. If the most significant bit of the 32-bit binary encoding of _n_ is 1, _p_ will be 0.</p>
<p>If _n_ is *+0*, _p_ will be 32. If the most significant bit of the 32-bit binary encoding of _n_ is 1, _p_ will be *+0*.</p>
</emu-note>
</emu-clause>

Expand Down Expand Up @@ -27994,10 +27994,10 @@ <h1>Year Number</h1>
<emu-eqn id="eqn-TimeFromYear" aoid="TimeFromYear">TimeFromYear(_y_) = msPerDay &times; DayFromYear(_y_)</emu-eqn>
<p>A time value determines a year by:</p>
<emu-eqn id="eqn-YearFromTime" aoid="YearFromTime">YearFromTime(_t_) = the largest integer _y_ (closest to positive infinity) such that TimeFromYear(_y_) &le; _t_</emu-eqn>
<p>The leap-year function is 1 for a time within a leap year and otherwise is zero:</p>
<p>The leap-year function is *1* for a time within a leap year and otherwise is *+0*:</p>
<emu-eqn id="eqn-InLeapYear" aoid="InLeapYear">InLeapYear(_t_)
= 0 if DaysInYear(YearFromTime(_t_)) = 365
= 1 if DaysInYear(YearFromTime(_t_)) = 366
= *+0* if DaysInYear(YearFromTime(_t_)) = 365
= *1* if DaysInYear(YearFromTime(_t_)) = 366
</emu-eqn>
</emu-clause>

Expand Down Expand Up @@ -28430,7 +28430,7 @@ <h1>Date.now ( )</h1>
<h1>Date.parse ( _string_ )</h1>
<p>The `parse` function applies the ToString operator to its argument. If ToString results in an abrupt completion the Completion Record is immediately returned. Otherwise, `parse` interprets the resulting String as a date and time; it returns a Number, the UTC time value corresponding to the date and time. The String may be interpreted as a local time, a UTC time, or a time in some other time zone, depending on the contents of the String. The function first attempts to parse the String according to the format described in Date Time String Format (<emu-xref href="#sec-date-time-string-format"></emu-xref>), including expanded years. If the String does not conform to that format the function may fall back to any implementation-specific heuristics or implementation-specific date formats. Strings that are unrecognizable or contain out-of-bounds format element values shall cause `Date.parse` to return *NaN*.</p>
<p>If the String conforms to the <emu-xref href="#sec-date-time-string-format">Date Time String Format</emu-xref>, substitute values take the place of absent format elements. When the `MM` or `DD` elements are absent, `"01"` is used. When the `HH`, `mm`, or `ss` elements are absent, `"00"` is used. When the `sss` element is absent, `"000"` is used. When the UTC offset representation is absent, date-only forms are interpreted as a UTC time and date-time forms are interpreted as a local time.</p>
<p>If `x` is any Date object whose milliseconds amount is zero within a particular implementation of ECMAScript, then all of the following expressions should produce the same numeric value in that implementation, if all the properties referenced have their initial values:</p>
<p>If `x` is any Date object whose milliseconds amount is *±0* within a particular implementation of ECMAScript, then all of the following expressions should produce the same numeric value in that implementation, if all the properties referenced have their initial values:</p>
<pre><code class="javascript">
x.valueOf()
Date.parse(x.toString())
Expand Down Expand Up @@ -29001,7 +29001,7 @@ <h1>Date.prototype.toString ( )</h1>
1. Return ToDateString(_tv_).
</emu-alg>
<emu-note>
<p>For any Date object `d` whose milliseconds amount is zero, the result of `Date.parse(d.toString())` is equal to `d.valueOf()`. See <emu-xref href="#sec-date.parse"></emu-xref>.</p>
<p>For any Date object `d` whose milliseconds amount is *±0*, the result of `Date.parse(d.toString())` is equal to `d.valueOf()`. See <emu-xref href="#sec-date.parse"></emu-xref>.</p>
</emu-note>
<emu-note>
<p>The `toString` function is not generic; it throws a *TypeError* exception if its *this* value is not a Date object. Therefore, it cannot be transferred to other kinds of objects for use as a method.</p>
Expand Down Expand Up @@ -29360,7 +29360,7 @@ <h1>String.fromCharCode ( ..._codeUnits_ )</h1>
1. Let _nextCU_ be ? ToUint16(_next_).
1. Append _nextCU_ to the end of _elements_.
1. Set _nextIndex_ to _nextIndex_ + 1.
1. Return the String value whose code units are, in order, the elements in the List _elements_. If _length_ is 0, the empty string is returned.
1. Return the String value whose code units are, in order, the elements in the List _elements_. If _length_ is *+0*, the empty string is returned.
</emu-alg>
<p>The `"length"` property of the `fromCharCode` function is 1.</p>
</emu-clause>
Expand All @@ -29380,7 +29380,7 @@ <h1>String.fromCodePoint ( ..._codePoints_ )</h1>
1. If _nextCP_ &lt; 0 or _nextCP_ &gt; 0x10FFFF, throw a *RangeError* exception.
1. Append the elements of the UTF16Encoding of _nextCP_ to the end of _elements_.
1. Set _nextIndex_ to _nextIndex_ + 1.
1. Return the String value whose code units are, in order, the elements in the List _elements_. If _length_ is 0, the empty string is returned.
1. Return the String value whose code units are, in order, the elements in the List _elements_. If _length_ is *+0*, the empty string is returned.
</emu-alg>
<p>The `"length"` property of the `fromCodePoint` function is 1.</p>
</emu-clause>
Expand Down Expand Up @@ -29428,7 +29428,7 @@ <h1>Properties of the String Prototype Object</h1>
<li>is the intrinsic object <dfn>%StringPrototype%</dfn>.</li>
<li>is a String exotic object and has the internal methods specified for such objects.</li>
<li>has a [[StringData]] internal slot whose value is the empty String.</li>
<li>has a `"length"` property whose initial value is 0 and whose attributes are { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.</li>
<li>has a `"length"` property whose initial value is *+0* and whose attributes are { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.</li>
<li>has a [[Prototype]] internal slot whose value is %Object.prototype%.</li>
</ul>
<p>Unless explicitly stated otherwise, the methods of the String prototype object defined below are not generic and the *this* value passed to them must be either a String value or an object that has a [[StringData]] internal slot that has been initialized to a String value.</p>
Expand Down Expand Up @@ -29568,7 +29568,7 @@ <h1>String.prototype.includes ( _searchString_ [ , _position_ ] )</h1>
1. If _isRegExp_ is *true*, throw a *TypeError* exception.
1. Let _searchStr_ be ? ToString(_searchString_).
1. Let _pos_ be ? ToInteger(_position_).
1. Assert: If _position_ is *undefined*, then _pos_ is 0.
1. Assert: If _position_ is *undefined*, then _pos_ is *+0*.
1. Let _len_ be the length of _S_.
1. Let _start_ be min(max(_pos_, 0), _len_).
1. Let _searchLen_ be the length of _searchStr_.
Expand Down Expand Up @@ -29596,7 +29596,7 @@ <h1>String.prototype.indexOf ( _searchString_ [ , _position_ ] )</h1>
1. Let _S_ be ? ToString(_O_).
1. Let _searchStr_ be ? ToString(_searchString_).
1. Let _pos_ be ? ToInteger(_position_).
1. Assert: If _position_ is *undefined*, then _pos_ is 0.
1. Assert: If _position_ is *undefined*, then _pos_ is *+0*.
1. Let _len_ be the length of _S_.
1. Let _start_ be min(max(_pos_, 0), _len_).
1. Let _searchLen_ be the length of _searchStr_.
Expand Down Expand Up @@ -29766,7 +29766,7 @@ <h1>String.prototype.repeat ( _count_ )</h1>
1. Let _n_ be ? ToInteger(_count_).
1. If _n_ &lt; 0, throw a *RangeError* exception.
1. If _n_ is *+&infin;*, throw a *RangeError* exception.
1. If _n_ is 0, return the empty String.
1. If _n_ is *±0*, return the empty String.
1. Return the String value that is made from _n_ copies of _S_ appended together.
</emu-alg>
<emu-note>
Expand Down Expand Up @@ -29799,7 +29799,7 @@ <h1>String.prototype.replace ( _searchValue_, _replaceValue_ )</h1>
1. Let _captures_ be a new empty List.
1. Let _replStr_ be GetSubstitution(_matched_, _string_, _pos_, _captures_, *undefined*, _replaceValue_).
1. Let _tailPos_ be _pos_ + the number of code units in _matched_.
1. Let _newString_ be the string-concatenation of the first _pos_ code units of _string_, _replStr_, and the trailing substring of _string_ starting at index _tailPos_. If _pos_ is 0, the first element of the concatenation will be the empty String.
1. Let _newString_ be the string-concatenation of the first _pos_ code units of _string_, _replStr_, and the trailing substring of _string_ starting at index _tailPos_. If _pos_ is *+0*, the first element of the concatenation will be the empty String.
1. Return _newString_.
</emu-alg>
<emu-note>
Expand Down Expand Up @@ -29869,7 +29869,7 @@ <h1>Runtime Semantics: GetSubstitution ( _matched_, _str_, _position_, _captures
<code>$`</code>
</td>
<td>
If _position_ is 0, the replacement is the empty String. Otherwise the replacement is the substring of _str_ that starts at index 0 and whose last code unit is at index _position_ - 1.
If _position_ is *+0*, the replacement is the empty String. Otherwise the replacement is the substring of _str_ that starts at index 0 and whose last code unit is at index _position_ - 1.
</td>
</tr>
<tr>
Expand Down Expand Up @@ -30069,7 +30069,7 @@ <h1>String.prototype.startsWith ( _searchString_ [ , _position_ ] )</h1>
1. If _isRegExp_ is *true*, throw a *TypeError* exception.
1. Let _searchStr_ be ? ToString(_searchString_).
1. Let _pos_ be ? ToInteger(_position_).
1. Assert: If _position_ is *undefined*, then _pos_ is 0.
1. Assert: If _position_ is *undefined*, then _pos_ is *+0*.
1. Let _len_ be the length of _S_.
1. Let _start_ be min(max(_pos_, 0), _len_).
1. Let _searchLength_ be the length of _searchStr_.
Expand Down Expand Up @@ -31063,10 +31063,10 @@ <h1>Term</h1>
<h1>Runtime Semantics: RepeatMatcher ( _m_, _min_, _max_, _greedy_, _x_, _c_, _parenIndex_, _parenCount_ )</h1>
<p>The abstract operation RepeatMatcher takes eight parameters, a Matcher _m_, an integer _min_, an integer (or &infin;) _max_, a Boolean _greedy_, a State _x_, a Continuation _c_, an integer _parenIndex_, and an integer _parenCount_, and performs the following steps:</p>
<emu-alg>
1. If _max_ is zero, return _c_(_x_).
1. If _max_ is *+0*, return _c_(_x_).
1. Let _d_ be an internal Continuation closure that takes one State argument _y_ and performs the following steps:
1. If _min_ is zero and _y_'s _endIndex_ is equal to _x_'s _endIndex_, return ~failure~.
1. If _min_ is zero, let _min2_ be zero; otherwise let _min2_ be _min_ - 1.
1. If _min_ is *+0* and _y_'s _endIndex_ is equal to _x_'s _endIndex_, return ~failure~.
1. If _min_ is *+0*, let _min2_ be zero; otherwise let _min2_ be _min_ - 1.
1. If _max_ is &infin;, let _max2_ be &infin;; otherwise let _max2_ be _max_ - 1.
1. Call RepeatMatcher(_m_, _min2_, _max2_, _greedy_, _y_, _c_, _parenIndex_, _parenCount_) and return its result.
1. Let _cap_ be a copy of _x_'s _captures_ List.
Expand Down Expand Up @@ -31131,7 +31131,7 @@ <h1>Assertion</h1>
<emu-alg>
1. Return an internal AssertionTester closure that takes a State argument _x_ and performs the following steps:
1. Let _e_ be _x_'s _endIndex_.
1. If _e_ is zero, return *true*.
1. If _e_ is *+0*, return *true*.
1. If _Multiline_ is *false*, return *false*.
1. If the character _Input_[_e_ - 1] is one of |LineTerminator|, return *true*.
1. Return *false*.
Expand Down Expand Up @@ -32901,7 +32901,7 @@ <h1>Properties of the Array Prototype Object</h1>
<ul>
<li>is the intrinsic object <dfn>%ArrayPrototype%</dfn>.</li>
<li>is an Array exotic object and has the internal methods specified for such objects.</li>
<li>has a `"length"` property whose initial value is 0 and whose attributes are { [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.</li>
<li>has a `"length"` property whose initial value is *+0* and whose attributes are { [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.</li>
<li>has a [[Prototype]] internal slot whose value is %Object.prototype%.</li>
</ul>
<emu-note>
Expand Down Expand Up @@ -33274,9 +33274,9 @@ <h1>Array.prototype.includes ( _searchElement_ [ , _fromIndex_ ] )</h1>
<emu-alg>
1. Let _O_ be ? ToObject(*this* value).
1. Let _len_ be ? LengthOfArrayLike(_O_).
1. If _len_ is 0, return *false*.
1. If _len_ is *+0*, return *false*.
1. Let _n_ be ? ToInteger(_fromIndex_).
1. Assert: If _fromIndex_ is *undefined*, then _n_ is 0.
1. Assert: If _fromIndex_ is *undefined*, then _n_ is *+0*.
1. If _n_ &ge; 0, then
1. Let _k_ be _n_.
1. Else,
Expand Down Expand Up @@ -33308,9 +33308,9 @@ <h1>Array.prototype.indexOf ( _searchElement_ [ , _fromIndex_ ] )</h1>
<emu-alg>
1. Let _O_ be ? ToObject(*this* value).
1. Let _len_ be ? LengthOfArrayLike(_O_).
1. If _len_ is 0, return -1.
1. If _len_ is *+0*, return -1.
1. Let _n_ be ? ToInteger(_fromIndex_).
1. Assert: If _fromIndex_ is *undefined*, then _n_ is 0.
1. Assert: If _fromIndex_ is *undefined*, then _n_ is *+0*.
1. If _n_ &ge; _len_, return -1.
1. If _n_ &ge; 0, then
1. If _n_ is *-0*, let _k_ be *+0*; else let _k_ be _n_.
Expand Down Expand Up @@ -33377,7 +33377,7 @@ <h1>Array.prototype.lastIndexOf ( _searchElement_ [ , _fromIndex_ ] )</h1>
<emu-alg>
1. Let _O_ be ? ToObject(*this* value).
1. Let _len_ be ? LengthOfArrayLike(_O_).
1. If _len_ is 0, return -1.
1. If _len_ is *+0*, return -1.
1. If _fromIndex_ is present, let _n_ be ? ToInteger(_fromIndex_); else let _n_ be _len_ - 1.
1. If _n_ &ge; 0, then
1. If _n_ is *-0*, let _k_ be *+0*; else let _k_ be min(_n_, _len_ - 1).
Expand Down Expand Up @@ -33438,7 +33438,7 @@ <h1>Array.prototype.pop ( )</h1>
<emu-alg>
1. Let _O_ be ? ToObject(*this* value).
1. Let _len_ be ? LengthOfArrayLike(_O_).
1. If _len_ is zero, then
1. If _len_ is *+0*, then
1. Perform ? Set(_O_, `"length"`, 0, *true*).
1. Return *undefined*.
1. Else,
Expand Down Expand Up @@ -33493,7 +33493,7 @@ <h1>Array.prototype.reduce ( _callbackfn_ [ , _initialValue_ ] )</h1>
1. Let _O_ be ? ToObject(*this* value).
1. Let _len_ be ? LengthOfArrayLike(_O_).
1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception.
1. If _len_ is 0 and _initialValue_ is not present, throw a *TypeError* exception.
1. If _len_ is *+0* and _initialValue_ is not present, throw a *TypeError* exception.
1. Let _k_ be 0.
1. Let _accumulator_ be *undefined*.
1. If _initialValue_ is present, then
Expand Down Expand Up @@ -33534,7 +33534,7 @@ <h1>Array.prototype.reduceRight ( _callbackfn_ [ , _initialValue_ ] )</h1>
1. Let _O_ be ? ToObject(*this* value).
1. Let _len_ be ? LengthOfArrayLike(_O_).
1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception.
1. If _len_ is 0 and _initialValue_ is not present, throw a *TypeError* exception.
1. If _len_ is *+0* and _initialValue_ is not present, throw a *TypeError* exception.
1. Let _k_ be _len_ - 1.
1. Let _accumulator_ be *undefined*.
1. If _initialValue_ is present, then
Expand Down Expand Up @@ -33612,7 +33612,7 @@ <h1>Array.prototype.shift ( )</h1>
<emu-alg>
1. Let _O_ be ? ToObject(*this* value).
1. Let _len_ be ? LengthOfArrayLike(_O_).
1. If _len_ is zero, then
1. If _len_ is *+0*, then
1. Perform ? Set(_O_, `"length"`, 0, *true*).
1. Return *undefined*.
1. Let _first_ be ? Get(_O_, `"0"`).
Expand Down Expand Up @@ -33847,7 +33847,7 @@ <h1>Array.prototype.splice ( _start_, _deleteCount_, ..._items_ )</h1>
1. Let _len_ be ? LengthOfArrayLike(_O_).
1. Let _relativeStart_ be ? ToInteger(_start_).
1. If _relativeStart_ &lt; 0, let _actualStart_ be max((_len_ + _relativeStart_), 0); else let _actualStart_ be min(_relativeStart_, _len_).
1. If the number of actual arguments is 0, then
1. If the number of actual arguments is *+0*, then
1. Let _insertCount_ be 0.
1. Let _actualDeleteCount_ be 0.
1. Else if the number of actual arguments is 1, then
Expand Down Expand Up @@ -34416,7 +34416,7 @@ <h1>%TypedArray% ( )</h1>
<emu-alg>
1. Throw a *TypeError* exception.
</emu-alg>
<p>The `"length"` property of the %TypedArray% constructor function is 0.</p>
<p>The `"length"` property of the %TypedArray% constructor function is *+0*.</p>
</emu-clause>
</emu-clause>

Expand Down

0 comments on commit 5f84cd9

Please sign in to comment.