Skip to content

Commit 40eaeb7

Browse files
sffcptomato
authored andcommitted
Always allow ~unset~ in the AO
1 parent adf50d4 commit 40eaeb7

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed

spec/abstractops.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@ <h1>
584584
<dd>It validates that the result of GetTemporalUnitValuedOption is <emu-not-ref>covered</emu-not-ref> by the union of _unitGroup_ and _extraValues_.</dd>
585585
</dl>
586586
<emu-alg>
587+
1. If _value_ is ~unset~, return ~unused~.
587588
1. If _extraValues_ is present and _extraValues_ contains _value_, return ~unused~.
588589
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.
589590
1. If _category_ is ~date~ and _unitGroup_ is ~date~ or ~datetime~, return ~unused~.
@@ -1864,7 +1865,7 @@ <h1>
18641865
<emu-alg>
18651866
1. NOTE: The following steps read options and perform independent validation in alphabetical order.
18661867
1. Let _largestUnit_ be ? GetTemporalUnitValuedOption(_options_, *"largestUnit"*, ~unset~).
1867-
1. Perform ? ValidateTemporalUnitValue(_largestUnit_, _unitGroup_, « ~unset~ »).
1868+
1. Perform ? ValidateTemporalUnitValue(_largestUnit_, _unitGroup_).
18681869
1. If _largestUnit_ is ~unset~, then
18691870
1. Set _largestUnit_ to ~auto~.
18701871
1. If _disallowedUnits_ contains _largestUnit_, throw a *RangeError* exception.
@@ -1873,7 +1874,7 @@ <h1>
18731874
1. If _operation_ is ~since~, then
18741875
1. Set _roundingMode_ to NegateRoundingMode(_roundingMode_).
18751876
1. Let _smallestUnit_ be ? GetTemporalUnitValuedOption(_options_, *"smallestUnit"*, ~unset~).
1876-
1. Perform ? ValidateTemporalUnitValue(_smallestUnit_, _unitGroup_, « ~unset~ »).
1877+
1. Perform ? ValidateTemporalUnitValue(_smallestUnit_, _unitGroup_).
18771878
1. If _smallestUnit_ is ~unset~, then
18781879
1. Set _smallestUnit_ to _fallbackSmallestUnit_.
18791880
1. If _disallowedUnits_ contains _smallestUnit_, throw a *RangeError* exception.

spec/duration.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,14 +403,14 @@ <h1>Temporal.Duration.prototype.round ( _roundTo_ )</h1>
403403
1. Let _largestUnitPresent_ be *true*.
404404
1. NOTE: The following steps read options and perform independent validation in alphabetical order (GetTemporalRelativeToOption reads *"relativeTo"*, GetRoundingIncrementOption reads *"roundingIncrement"* and GetRoundingModeOption reads *"roundingMode"*).
405405
1. Let _largestUnit_ be ? GetTemporalUnitValuedOption(_roundTo_, *"largestUnit"*, ~unset~).
406-
1. Perform ? ValidateTemporalUnitValue(_largestUnit_, ~datetime~, « ~auto~, ~unset~ »).
406+
1. Perform ? ValidateTemporalUnitValue(_largestUnit_, ~datetime~, « ~auto~ »).
407407
1. Let _relativeToRecord_ be ? GetTemporalRelativeToOption(_roundTo_).
408408
1. Let _zonedRelativeTo_ be _relativeToRecord_.[[ZonedRelativeTo]].
409409
1. Let _plainRelativeTo_ be _relativeToRecord_.[[PlainRelativeTo]].
410410
1. Let _roundingIncrement_ be ? GetRoundingIncrementOption(_roundTo_).
411411
1. Let _roundingMode_ be ? GetRoundingModeOption(_roundTo_, ~half-expand~).
412412
1. Let _smallestUnit_ be ? GetTemporalUnitValuedOption(_roundTo_, *"smallestUnit"*, ~unset~).
413-
1. Perform ? ValidateTemporalUnitValue(_smallestUnit_, ~datetime~, « ~unset~ »).
413+
1. Perform ? ValidateTemporalUnitValue(_smallestUnit_, ~datetime~).
414414
1. If _smallestUnit_ is ~unset~, then
415415
1. Set _smallestUnitPresent_ to *false*.
416416
1. Set _smallestUnit_ to ~nanosecond~.
@@ -516,7 +516,7 @@ <h1>Temporal.Duration.prototype.toString ( [ _options_ ] )</h1>
516516
1. Let _digits_ be ? GetTemporalFractionalSecondDigitsOption(_resolvedOptions_).
517517
1. Let _roundingMode_ be ? GetRoundingModeOption(_resolvedOptions_, ~trunc~).
518518
1. Let _smallestUnit_ be ? GetTemporalUnitValuedOption(_resolvedOptions_, *"smallestUnit"*, ~unset~).
519-
1. Perform ? ValidateTemporalUnitValue(_smallestUnit_, ~time~, « ~unset~ »).
519+
1. Perform ? ValidateTemporalUnitValue(_smallestUnit_, ~time~).
520520
1. If _smallestUnit_ is ~hour~ or ~minute~, throw a *RangeError* exception.
521521
1. Let _precision_ be ToSecondsStringPrecisionRecord(_smallestUnit_, _digits_).
522522
1. If _precision_.[[Unit]] is ~nanosecond~ and _precision_.[[Increment]] = 1, then

spec/instant.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ <h1>Temporal.Instant.prototype.toString ( [ _options_ ] )</h1>
237237
1. Let _digits_ be ? GetTemporalFractionalSecondDigitsOption(_resolvedOptions_).
238238
1. Let _roundingMode_ be ? GetRoundingModeOption(_resolvedOptions_, ~trunc~).
239239
1. Let _smallestUnit_ be ? GetTemporalUnitValuedOption(_resolvedOptions_, *"smallestUnit"*, ~unset~).
240-
1. Perform ? ValidateTemporalUnitValue(_smallestUnit_, ~time~, « ~unset~ »).
240+
1. Perform ? ValidateTemporalUnitValue(_smallestUnit_, ~time~).
241241
1. If _smallestUnit_ is ~hour~, throw a *RangeError* exception.
242242
1. Let _timeZone_ be ? Get(_resolvedOptions_, *"timeZone"*).
243243
1. If _timeZone_ is not *undefined*, then

spec/plaindatetime.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ <h1>Temporal.PlainDateTime.prototype.toString ( [ _options_ ] )</h1>
543543
1. Let _digits_ be ? GetTemporalFractionalSecondDigitsOption(_resolvedOptions_).
544544
1. Let _roundingMode_ be ? GetRoundingModeOption(_resolvedOptions_, ~trunc~).
545545
1. Let _smallestUnit_ be ? GetTemporalUnitValuedOption(_resolvedOptions_, *"smallestUnit"*, ~unset~).
546-
1. Perform ? ValidateTemporalUnitValue(_smallestUnit_, ~time~, « ~unset~ »).
546+
1. Perform ? ValidateTemporalUnitValue(_smallestUnit_, ~time~).
547547
1. If _smallestUnit_ is ~hour~, throw a *RangeError* exception.
548548
1. Let _precision_ be ToSecondsStringPrecisionRecord(_smallestUnit_, _digits_).
549549
1. Let _result_ be RoundISODateTime(_plainDateTime_.[[ISODateTime]], _precision_.[[Increment]], _precision_.[[Unit]], _roundingMode_).

spec/plaintime.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ <h1>Temporal.PlainTime.prototype.toString ( [ _options_ ] )</h1>
305305
1. Let _digits_ be ? GetTemporalFractionalSecondDigitsOption(_resolvedOptions_).
306306
1. Let _roundingMode_ be ? GetRoundingModeOption(_resolvedOptions_, ~trunc~).
307307
1. Let _smallestUnit_ be ? GetTemporalUnitValuedOption(_resolvedOptions_, *"smallestUnit"*, ~unset~).
308-
1. Perform ? ValidateTemporalUnitValue(_smallestUnit_, ~time~, « ~unset~ »).
308+
1. Perform ? ValidateTemporalUnitValue(_smallestUnit_, ~time~).
309309
1. If _smallestUnit_ is ~hour~, throw a *RangeError* exception.
310310
1. Let _precision_ be ToSecondsStringPrecisionRecord(_smallestUnit_, _digits_).
311311
1. Let _roundResult_ be RoundTime(_plainTime_.[[Time]], _precision_.[[Increment]], _precision_.[[Unit]], _roundingMode_).

spec/zoneddatetime.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ <h1>Temporal.ZonedDateTime.prototype.toString ( [ _options_ ] )</h1>
694694
1. Let _showOffset_ be ? GetTemporalShowOffsetOption(_resolvedOptions_).
695695
1. Let _roundingMode_ be ? GetRoundingModeOption(_resolvedOptions_, ~trunc~).
696696
1. Let _smallestUnit_ be ? GetTemporalUnitValuedOption(_resolvedOptions_, *"smallestUnit"*, ~unset~).
697-
1. Perform ? ValidateTemporalUnitValue(_smallestUnit_, ~time~, « ~unset~ »).
697+
1. Perform ? ValidateTemporalUnitValue(_smallestUnit_, ~time~).
698698
1. If _smallestUnit_ is ~hour~, throw a *RangeError* exception.
699699
1. Let _showTimeZone_ be ? GetTemporalShowTimeZoneNameOption(_resolvedOptions_).
700700
1. Let _precision_ be ToSecondsStringPrecisionRecord(_smallestUnit_, _digits_).

0 commit comments

Comments
 (0)