From 5f84cd9cff7d18f93d48aa8ac82ef19da260c07b Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 29 Jan 2018 14:07:13 -0800 Subject: [PATCH] Editorial: use "is 0" instead of "is zero" for consistency (#1086) --- spec.html | 90 +++++++++++++++++++++++++++---------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/spec.html b/spec.html index 0803a38cee5..cb530d4ae0c 100644 --- a/spec.html +++ b/spec.html @@ -1924,31 +1924,31 @@

BigInt::sameValueZero ( _x_, _y_ )

BinaryAnd ( _x_, _y_ )

- 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*.

BinaryOr ( _x_, _y_ )

- 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*.

BinaryXor ( _x_, _y_ )

- 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*.
@@ -4515,7 +4515,7 @@

ToBoolean ( _argument_ )

String - 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*. @@ -27439,7 +27439,7 @@

Math.clz32 ( _x_ )

1. Return _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.

+

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*.

@@ -27994,10 +27994,10 @@

Year Number

TimeFromYear(_y_) = msPerDay × DayFromYear(_y_)

A time value determines a year by:

YearFromTime(_t_) = the largest integer _y_ (closest to positive infinity) such that TimeFromYear(_y_) ≤ _t_ -

The leap-year function is 1 for a time within a leap year and otherwise is zero:

+

The leap-year function is *1* for a time within a leap year and otherwise is *+0*:

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 @@ -28430,7 +28430,7 @@

Date.now ( )

Date.parse ( _string_ )

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 (), 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*.

If the String conforms to the Date Time String Format, 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.

-

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:

+

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:


           x.valueOf()
           Date.parse(x.toString())
@@ -29001,7 +29001,7 @@ 

Date.prototype.toString ( )

1. Return ToDateString(_tv_). -

For any Date object `d` whose milliseconds amount is zero, the result of `Date.parse(d.toString())` is equal to `d.valueOf()`. See .

+

For any Date object `d` whose milliseconds amount is *±0*, the result of `Date.parse(d.toString())` is equal to `d.valueOf()`. See .

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.

@@ -29360,7 +29360,7 @@

String.fromCharCode ( ..._codeUnits_ )

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.

The `"length"` property of the `fromCharCode` function is 1.

@@ -29380,7 +29380,7 @@

String.fromCodePoint ( ..._codePoints_ )

1. If _nextCP_ < 0 or _nextCP_ > 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.

The `"length"` property of the `fromCodePoint` function is 1.

@@ -29428,7 +29428,7 @@

Properties of the String Prototype Object

  • is the intrinsic object %StringPrototype%.
  • is a String exotic object and has the internal methods specified for such objects.
  • has a [[StringData]] internal slot whose value is the empty String.
  • -
  • has a `"length"` property whose initial value is 0 and whose attributes are { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.
  • +
  • has a `"length"` property whose initial value is *+0* and whose attributes are { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.
  • has a [[Prototype]] internal slot whose value is %Object.prototype%.
  • 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.

    @@ -29568,7 +29568,7 @@

    String.prototype.includes ( _searchString_ [ , _position_ ] )

    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_. @@ -29596,7 +29596,7 @@

    String.prototype.indexOf ( _searchString_ [ , _position_ ] )

    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_. @@ -29766,7 +29766,7 @@

    String.prototype.repeat ( _count_ )

    1. Let _n_ be ? ToInteger(_count_). 1. If _n_ < 0, throw a *RangeError* exception. 1. If _n_ is *+∞*, 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. @@ -29799,7 +29799,7 @@

    String.prototype.replace ( _searchValue_, _replaceValue_ )

    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_. @@ -29869,7 +29869,7 @@

    Runtime Semantics: GetSubstitution ( _matched_, _str_, _position_, _captures $` - 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. @@ -30069,7 +30069,7 @@

    String.prototype.startsWith ( _searchString_ [ , _position_ ] )

    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_. @@ -31063,10 +31063,10 @@

    Term

    Runtime Semantics: RepeatMatcher ( _m_, _min_, _max_, _greedy_, _x_, _c_, _parenIndex_, _parenCount_ )

    The abstract operation RepeatMatcher takes eight parameters, a Matcher _m_, an integer _min_, an integer (or ∞) _max_, a Boolean _greedy_, a State _x_, a Continuation _c_, an integer _parenIndex_, and an integer _parenCount_, and performs the following steps:

    - 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 ∞, let _max2_ be ∞; 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. @@ -31131,7 +31131,7 @@

    Assertion

    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*. @@ -32901,7 +32901,7 @@

    Properties of the Array Prototype Object

    • is the intrinsic object %ArrayPrototype%.
    • is an Array exotic object and has the internal methods specified for such objects.
    • -
    • has a `"length"` property whose initial value is 0 and whose attributes are { [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.
    • +
    • has a `"length"` property whose initial value is *+0* and whose attributes are { [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.
    • has a [[Prototype]] internal slot whose value is %Object.prototype%.
    @@ -33274,9 +33274,9 @@

    Array.prototype.includes ( _searchElement_ [ , _fromIndex_ ] )

    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_ ≥ 0, then 1. Let _k_ be _n_. 1. Else, @@ -33308,9 +33308,9 @@

    Array.prototype.indexOf ( _searchElement_ [ , _fromIndex_ ] )

    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_ ≥ _len_, return -1. 1. If _n_ ≥ 0, then 1. If _n_ is *-0*, let _k_ be *+0*; else let _k_ be _n_. @@ -33377,7 +33377,7 @@

    Array.prototype.lastIndexOf ( _searchElement_ [ , _fromIndex_ ] )

    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_ ≥ 0, then 1. If _n_ is *-0*, let _k_ be *+0*; else let _k_ be min(_n_, _len_ - 1). @@ -33438,7 +33438,7 @@

    Array.prototype.pop ( )

    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, @@ -33493,7 +33493,7 @@

    Array.prototype.reduce ( _callbackfn_ [ , _initialValue_ ] )

    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 @@ -33534,7 +33534,7 @@

    Array.prototype.reduceRight ( _callbackfn_ [ , _initialValue_ ] )

    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 @@ -33612,7 +33612,7 @@

    Array.prototype.shift ( )

    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"`). @@ -33847,7 +33847,7 @@

    Array.prototype.splice ( _start_, _deleteCount_, ..._items_ )

    1. Let _len_ be ? LengthOfArrayLike(_O_). 1. Let _relativeStart_ be ? ToInteger(_start_). 1. If _relativeStart_ < 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 @@ -34416,7 +34416,7 @@

    %TypedArray% ( )

    1. Throw a *TypeError* exception. -

    The `"length"` property of the %TypedArray% constructor function is 0.

    +

    The `"length"` property of the %TypedArray% constructor function is *+0*.