Skip to content

Commit b576c46

Browse files
committed
Editorial: Remove no-op ValidateTemporalUnitValue call
largestUnit can be any unit, ~auto~, or ~unset~ here. ValidateTemporalUnitValue just checks if it is any unit, ~auto~, or ~unset~, so it's a no-op.
1 parent 6964def commit b576c46

File tree

2 files changed

+0
-2
lines changed

2 files changed

+0
-2
lines changed

polyfill/lib/duration.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ export class Duration {
194194
}
195195

196196
let largestUnit = ES.GetTemporalUnitValuedOption(roundTo, 'largestUnit');
197-
ES.ValidateTemporalUnitValue(largestUnit, 'datetime', ['auto']);
198197
let { plainRelativeTo, zonedRelativeTo } = ES.GetTemporalRelativeToOption(roundTo);
199198
const roundingIncrement = ES.GetRoundingIncrementOption(roundTo);
200199
const roundingMode = ES.GetRoundingModeOption(roundTo, 'halfExpand');

spec/duration.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,6 @@ <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]].

0 commit comments

Comments
 (0)