Skip to content

Commit

Permalink
Editorial: AdjustDateDurationRecord in NudgeToDayOrTime is infallible
Browse files Browse the repository at this point in the history
Quoting Anba: days is either zero or roundedWholeDays. When zero,
AdjustDateDurationRecord is trivially infallible. When roundedWholeDays,
it's also infallible, because roundedWholeDays is
truncate(DivideTimeDuration(roundedNorm, nsPerDay)) and roundedNorm is a
valid time duration.

Closes: #3033
  • Loading branch information
ptomato committed Dec 5, 2024
1 parent 3fbfc4a commit 61fb206
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/duration.html
Original file line number Diff line number Diff line change
Expand Up @@ -1733,7 +1733,7 @@ <h1>
1. If TemporalUnitCategory(_largestUnit_) is ~date~, then
1. Set _days_ to _roundedWholeDays_.
1. Set _remainder_ to ! AddTimeDuration(_roundedTime_, TimeDurationFromComponents(-_roundedWholeDays_ * HoursPerDay, 0, 0, 0, 0, 0)).
1. Let _dateDuration_ be ? AdjustDateDurationRecord(_duration_.[[Date]], _days_).
1. Let _dateDuration_ be ! AdjustDateDurationRecord(_duration_.[[Date]], _days_).
1. Let _resultDuration_ be ? CombineDateAndTimeDuration(_dateDuration_, _remainder_).
1. Return Duration Nudge Result Record { [[Duration]]: _resultDuration_, [[NudgedEpochNs]]: _nudgedEpochNs_, [[DidExpandCalendarUnit]]: _didExpandDays_ }.
</emu-alg>
Expand Down

0 comments on commit 61fb206

Please sign in to comment.