Skip to content

Commit 5f93566

Browse files
sffcptomato
authored andcommitted
Normative: Delay validation of unit-valued options
1 parent a10d38d commit 5f93566

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

spec/duration.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,13 +403,13 @@ <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~ »).
407406
1. Let _relativeToRecord_ be ? GetTemporalRelativeToOption(_roundTo_).
408407
1. Let _zonedRelativeTo_ be _relativeToRecord_.[[ZonedRelativeTo]].
409408
1. Let _plainRelativeTo_ be _relativeToRecord_.[[PlainRelativeTo]].
410409
1. Let _roundingIncrement_ be ? GetRoundingIncrementOption(_roundTo_).
411410
1. Let _roundingMode_ be ? GetRoundingModeOption(_roundTo_, ~half-expand~).
412411
1. Let _smallestUnit_ be ? GetTemporalUnitValuedOption(_roundTo_, *"smallestUnit"*, ~unset~).
412+
1. Perform ? ValidateTemporalUnitValue(_largestUnit_, ~datetime~, « ~auto~ »).
413413
1. Perform ? ValidateTemporalUnitValue(_smallestUnit_, ~datetime~).
414414
1. If _smallestUnit_ is ~unset~, then
415415
1. Set _smallestUnitPresent_ to *false*.

spec/instant.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@ <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. Let _timeZone_ be ? Get(_resolvedOptions_, *"timeZone"*).
240241
1. Perform ? ValidateTemporalUnitValue(_smallestUnit_, ~time~).
241242
1. If _smallestUnit_ is ~hour~, throw a *RangeError* exception.
242-
1. Let _timeZone_ be ? Get(_resolvedOptions_, *"timeZone"*).
243243
1. If _timeZone_ is not *undefined*, then
244244
1. Set _timeZone_ to ? ToTemporalTimeZoneIdentifier(_timeZone_).
245245
1. Let _precision_ be ToSecondsStringPrecisionRecord(_smallestUnit_, _digits_).

spec/zoneddatetime.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,9 +694,9 @@ <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. Let _showTimeZone_ be ? GetTemporalShowTimeZoneNameOption(_resolvedOptions_).
697698
1. Perform ? ValidateTemporalUnitValue(_smallestUnit_, ~time~).
698699
1. If _smallestUnit_ is ~hour~, throw a *RangeError* exception.
699-
1. Let _showTimeZone_ be ? GetTemporalShowTimeZoneNameOption(_resolvedOptions_).
700700
1. Let _precision_ be ToSecondsStringPrecisionRecord(_smallestUnit_, _digits_).
701701
1. Return TemporalZonedDateTimeToString(_zonedDateTime_, _precision_.[[Precision]], _showCalendar_, _showTimeZone_, _showOffset_, _precision_.[[Increment]], _precision_.[[Unit]], _roundingMode_).
702702
</emu-alg>

0 commit comments

Comments
 (0)