Skip to content

Commit 5b02980

Browse files
committed
Editorial: Use "either" or "one of" when comparing multiple items
As per editorial conventions, 'prefer "if a is either b or c" over "if a is b or a is c"; use "one of" in place of "either" when more than 2 options' https://github.com/tc39/ecma262/wiki/Editorial-Conventions#comparisons
1 parent 67ca9de commit 5b02980

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

spec/abstractops.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ <h1>
456456
1. If _digitsValue_ is not a Number, then
457457
1. If ? ToString(_digitsValue_) is not *"auto"*, throw a *RangeError* exception.
458458
1. Return ~auto~.
459-
1. If _digitsValue_ is *NaN*, *+∞*<sub>𝔽</sub>, or *-∞*<sub>𝔽</sub>, throw a *RangeError* exception.
459+
1. If _digitsValue_ is one of *NaN*, *+∞*<sub>𝔽</sub>, or *-∞*<sub>𝔽</sub>, throw a *RangeError* exception.
460460
1. Let _digitCount_ be floor(ℝ(_digitsValue_)).
461461
1. If _digitCount_ &lt; 0 or _digitCount_ > 9, throw a *RangeError* exception.
462462
1. Return _digitCount_.
@@ -587,8 +587,8 @@ <h1>
587587
1. If _value_ is ~unset~, return ~unused~.
588588
1. If _extraValues_ is present and _extraValues_ contains _value_, return ~unused~.
589589
1. Let _category_ be the value in the “Category” column of the row of <emu-xref href="#table-temporal-units"></emu-xref> whose “Value” column contains _value_. If there is no such row, throw a *RangeError* exception.
590-
1. If _category_ is ~date~ and _unitGroup_ is ~date~ or ~datetime~, return ~unused~.
591-
1. If _category_ is ~time~ and _unitGroup_ is ~time~ or ~datetime~, return ~unused~.
590+
1. If _category_ is ~date~ and _unitGroup_ is either ~date~ or ~datetime~, return ~unused~.
591+
1. If _category_ is ~time~ and _unitGroup_ is either ~time~ or ~datetime~, return ~unused~.
592592
1. Throw a *RangeError* exception.
593593
</emu-alg>
594594
</emu-clause>
@@ -1809,7 +1809,7 @@ <h1>
18091809
</dl>
18101810
<emu-alg>
18111811
1. Let _number_ be ? ToNumber(_argument_).
1812-
1. If _number_ is *NaN*, *+∞*<sub>𝔽</sub> or *-∞*<sub>𝔽</sub>, throw a *RangeError* exception.
1812+
1. If _number_ is one of *NaN*, *+∞*<sub>𝔽</sub>, or *-∞*<sub>𝔽</sub>, throw a *RangeError* exception.
18131813
1. Return truncate(ℝ(_number_)).
18141814
</emu-alg>
18151815
</emu-clause>
@@ -1851,9 +1851,9 @@ <h1>
18511851
1. Let _fields_ be an empty Calendar Fields Record with all fields set to ~unset~.
18521852
1. Let _calendarDate_ be CalendarISOToDate(_calendar_, _isoDate_).
18531853
1. Set _fields_.[[MonthCode]] to _calendarDate_.[[MonthCode]].
1854-
1. If _type_ is ~month-day~ or ~date~, then
1854+
1. If _type_ is either ~month-day~ or ~date~, then
18551855
1. Set _fields_.[[Day]] to _calendarDate_.[[Day]].
1856-
1. If _type_ is ~year-month~ or ~date~, then
1856+
1. If _type_ is either ~year-month~ or ~date~, then
18571857
1. Set _fields_.[[Year]] to _calendarDate_.[[Year]].
18581858
1. Return _fields_.
18591859
</emu-alg>

spec/calendar.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ <h1>
641641
1. Set _years_ to _candidateYears_.
642642
1. Set _candidateYears_ to _candidateYears_ + _sign_.
643643
1. Let _months_ be 0.
644-
1. If _largestUnit_ is ~year~ or _largestUnit_ is ~month~, then
644+
1. If _largestUnit_ is either ~year~ or ~month~, then
645645
1. Let _candidateMonths_ be _sign_.
646646
1. Repeat, while ISODateSurpasses(_sign_, _one_, _two_, _years_, _candidateMonths_, 0, 0) is *false*,
647647
1. Set _months_ to _candidateMonths_.
@@ -822,8 +822,8 @@ <h1>
822822
<dd>It returns the number of days in the given year and month in the ISO 8601 calendar.</dd>
823823
</dl>
824824
<emu-alg>
825-
1. If _month_ is 1, 3, 5, 7, 8, 10, or 12, return 31.
826-
1. If _month_ is 4, 6, 9, or 11, return 30.
825+
1. If _month_ is one of 1, 3, 5, 7, 8, 10, or 12, return 31.
826+
1. If _month_ is one of 4, 6, 9, or 11, return 30.
827827
1. Assert: _month_ = 2.
828828
1. Return 28 + MathematicalInLeapYear(EpochTimeForYear(_year_)).
829829
</emu-alg>
@@ -1202,7 +1202,7 @@ <h1>
12021202
</dl>
12031203
<p>The operation throws a *TypeError* exception if the non-~unset~ fields of _fields_ are insufficient to identify a unique instance of _type_ in the calendar (e.g., when at least one field in each combination capable of determining some part of its data is ~unset~) or a *RangeError* exception if the fields are sufficient but their values are internally inconsistent within the calendar (e.g., when fields such as [[Month]] and [[MonthCode]] have conflicting non-~unset~ values). For example:</p>
12041204
<ul>
1205-
<li>If _type_ is ~date~ or ~month-day~ and "day" in the calendar has an interpretation similar to ISO 8601 and _fields_.[[Day]] is ~unset~.</li>
1205+
<li>If _type_ is either ~date~ or ~month-day~, and "day" in the calendar has an interpretation similar to ISO 8601 and _fields_.[[Day]] is ~unset~.</li>
12061206
<li>If _fields_.[[MonthCode]] identifies a month code that is not valid in any year of the calendar.</li>
12071207
<li>If _fields_.[[Month]] and _fields_.[[MonthCode]] are both ~unset~ or neither value is ~unset~ but they do not identify the same month.</li>
12081208
<li>If _type_ is ~month-day~ and _fields_.[[MonthCode]] is ~unset~ and a specific year cannot be determined from _fields_.</li>
@@ -1247,9 +1247,9 @@ <h1>
12471247
<emu-alg>
12481248
1. If _calendar_ is *"iso8601"*, then
12491249
1. Let _needsYear_ be *false*.
1250-
1. If _type_ is ~date~ or _type_ is ~year-month~, set _needsYear_ to *true*.
1250+
1. If _type_ is either ~date~ or ~year-month~, set _needsYear_ to *true*.
12511251
1. Let _needsDay_ be *false*.
1252-
1. If _type_ is ~date~ or _type_ is ~month-day~, set _needsDay_ to *true*.
1252+
1. If _type_ is either ~date~ or ~month-day~, set _needsDay_ to *true*.
12531253
1. If _needsYear_ is *true* and _fields_.[[Year]] is ~unset~, throw a *TypeError* exception.
12541254
1. If _needsDay_ is *true* and _fields_.[[Day]] is ~unset~, throw a *TypeError* exception.
12551255
1. If _fields_.[[Month]] is ~unset~ and _fields_.[[MonthCode]] is ~unset~, throw a *TypeError* exception.

spec/duration.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ <h1>Temporal.Duration.compare ( _one_, _two_ [ , _options_ ] )</h1>
9494
1. Let _largestUnit2_ be DefaultTemporalLargestUnit(_two_).
9595
1. Let _duration1_ be ToInternalDurationRecord(_one_).
9696
1. Let _duration2_ be ToInternalDurationRecord(_two_).
97-
1. If _zonedRelativeTo_ is not *undefined*, and either TemporalUnitCategory(_largestUnit1_) or TemporalUnitCategory(_largestUnit2_) is ~date~, then
97+
1. If _zonedRelativeTo_ is not *undefined*, and TemporalUnitCategory(_largestUnit1_) is ~date~ or TemporalUnitCategory(_largestUnit2_) is ~date~, then
9898
1. Let _timeZone_ be _zonedRelativeTo_.[[TimeZone]].
9999
1. Let _calendar_ be _zonedRelativeTo_.[[Calendar]].
100100
1. Let _after1_ be ? AddZonedDateTime(_zonedRelativeTo_.[[EpochNanoseconds]], _timeZone_, _calendar_, _duration1_, ~constrain~).
@@ -445,7 +445,7 @@ <h1>Temporal.Duration.prototype.round ( _roundTo_ )</h1>
445445
1. Let _targetDateTime_ be CombineISODateAndTimeRecord(_targetDate_, _targetTime_).
446446
1. Set _internalDuration_ to ? DifferencePlainDateTimeWithRounding(_isoDateTime_, _targetDateTime_, _calendar_, _largestUnit_, _roundingIncrement_, _smallestUnit_, _roundingMode_).
447447
1. Return ? TemporalDurationFromInternal(_internalDuration_, _largestUnit_).
448-
1. If IsCalendarUnit(_existingLargestUnit_) is *true*, or IsCalendarUnit(_largestUnit_) is *true*, throw a *RangeError* exception.
448+
1. If IsCalendarUnit(_existingLargestUnit_) is *true* or IsCalendarUnit(_largestUnit_) is *true*, throw a *RangeError* exception.
449449
1. Assert: IsCalendarUnit(_smallestUnit_) is *false*.
450450
1. Let _internalDuration_ be ToInternalDurationRecordWith24HourDays(_duration_).
451451
1. If _smallestUnit_ is ~day~, then
@@ -497,7 +497,7 @@ <h1>Temporal.Duration.prototype.total ( _totalOf_ )</h1>
497497
1. Let _total_ be ? DifferencePlainDateTimeWithTotal(_isoDateTime_, _targetDateTime_, _calendar_, _unit_).
498498
1. Else,
499499
1. Let _largestUnit_ be DefaultTemporalLargestUnit(_duration_).
500-
1. If IsCalendarUnit(_largestUnit_) is *true*, or IsCalendarUnit(_unit_) is *true*, throw a *RangeError* exception.
500+
1. If IsCalendarUnit(_largestUnit_) is *true* or IsCalendarUnit(_unit_) is *true*, throw a *RangeError* exception.
501501
1. Let _internalDuration_ be ToInternalDurationRecordWith24HourDays(_duration_).
502502
1. Let _total_ be TotalTimeDuration(_internalDuration_.[[Time]], _unit_).
503503
1. Return 𝔽(_total_).
@@ -516,7 +516,7 @@ <h1>Temporal.Duration.prototype.toString ( [ _options_ ] )</h1>
516516
1. Let _roundingMode_ be ? GetRoundingModeOption(_resolvedOptions_, ~trunc~).
517517
1. Let _smallestUnit_ be ? GetTemporalUnitValuedOption(_resolvedOptions_, *"smallestUnit"*, ~unset~).
518518
1. Perform ? ValidateTemporalUnitValue(_smallestUnit_, ~time~).
519-
1. If _smallestUnit_ is ~hour~ or ~minute~, throw a *RangeError* exception.
519+
1. If _smallestUnit_ is either ~hour~ or ~minute~, throw a *RangeError* exception.
520520
1. Let _precision_ be ToSecondsStringPrecisionRecord(_smallestUnit_, _digits_).
521521
1. If _precision_.[[Unit]] is ~nanosecond~ and _precision_.[[Increment]] = 1, then
522522
1. Return TemporalDurationToString(_duration_, _precision_.[[Precision]]).
@@ -1943,7 +1943,7 @@ <h1>
19431943
1. If _duration_.[[Minutes]] ≠ 0, then
19441944
1. Set _timePart_ to the string concatenation of _timePart_, abs(_duration_.[[Minutes]]) formatted as a decimal number, and the code unit 0x004D (LATIN CAPITAL LETTER M).
19451945
1. Let _zeroMinutesAndHigher_ be *false*.
1946-
1. If DefaultTemporalLargestUnit(_duration_) is ~second~, ~millisecond~, ~microsecond~, or ~nanosecond~, set _zeroMinutesAndHigher_ to *true*.
1946+
1. If DefaultTemporalLargestUnit(_duration_) is one of ~second~, ~millisecond~, ~microsecond~, or ~nanosecond~, set _zeroMinutesAndHigher_ to *true*.
19471947
1. Let _secondsDuration_ be TimeDurationFromComponents(0, 0, _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]]).
19481948
1. If _secondsDuration_ ≠ 0, or _zeroMinutesAndHigher_ is *true*, or _precision_ is not ~auto~, then
19491949
1. Let _secondsPart_ be abs(truncate(_secondsDuration_ / 10<sup>9</sup>)) formatted as a decimal number.

spec/intl.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ <h1>
616616
1. Let _formatOptions_ be a new Record.
617617
1. If _required_ is one of ~date~, ~year-month~, or ~any~, then
618618
1. Set _formatOptions_.[[era]] to _options_.[[era]].
619-
1. If _required_ is ~time~ or ~any~, then
619+
1. If _required_ is either ~time~ or ~any~, then
620620
1. Set _formatOptions_.[[hourCycle]] to _options_.[[hourCycle]].
621621
1. Let _anyPresent_ be *false*.
622622
1. For each property name _prop_ of « *"weekday"*, *"year"*, *"month"*, *"day"*, *"dayPeriod"*, *"hour"*, *"minute"*, *"second"*, *"fractionalSecondDigits"* », do
@@ -1099,7 +1099,7 @@ <h1>
10991099
<dl class="header">
11001100
</dl>
11011101
<emu-alg>
1102-
1. If _temporalDate_.[[Calendar]] is not _dateTimeFormat_.[[Calendar]] or *"iso8601"*, throw a *RangeError* exception.
1102+
1. If _temporalDate_.[[Calendar]] is not either _dateTimeFormat_.[[Calendar]] or *"iso8601"*, throw a *RangeError* exception.
11031103
1. Let _isoDateTime_ be CombineISODateAndTimeRecord(_temporalDate_.[[ISODate]], NoonTimeRecord()).
11041104
1. Let _epochNs_ be GetUTCEpochNanoseconds(_isoDateTime_).
11051105
1. Let _format_ be _dateTimeFormat_.[[TemporalPlainDateFormat]].

spec/plaintime.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ <h1>
882882
<dd>It rounds a time to the given increment.</dd>
883883
</dl>
884884
<emu-alg>
885-
1. If _unit_ is ~day~ or ~hour~, then
885+
1. If _unit_ is either ~day~ or ~hour~, then
886886
1. Let _quantity_ be ((((_time_.[[Hour]] × 60 + _time_.[[Minute]]) × 60 + _time_.[[Second]]) × 1000 + _time_.[[Millisecond]]) × 1000 + _time_.[[Microsecond]]) × 1000 + _time_.[[Nanosecond]].
887887
1. Else if _unit_ is ~minute~, then
888888
1. Let _quantity_ be (((_time_.[[Minute]] × 60 + _time_.[[Second]]) × 1000 + _time_.[[Millisecond]]) × 1000 + _time_.[[Microsecond]]) × 1000 + _time_.[[Nanosecond]].

spec/timezone.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ <h1>
299299
1. If _n_ = 1, then
300300
1. Return the sole element of _possibleEpochNs_.
301301
1. If _n_ ≠ 0, then
302-
1. If _disambiguation_ is ~earlier~ or ~compatible~, then
302+
1. If _disambiguation_ is either ~earlier~ or ~compatible~, then
303303
1. Return _possibleEpochNs_[0].
304304
1. If _disambiguation_ is ~later~, then
305305
1. Return _possibleEpochNs_[_n_ - 1].

0 commit comments

Comments
 (0)