mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 01:32:14 -05:00
LibJS: Mark TemporalDurationFromInternal as infallible in difference AOs
This is an editorial change in the Temporal proposal. See: https://github.com/tc39/proposal-temporal/commit/76c6612
This commit is contained in:
parent
81b38c66a8
commit
4f07cddb2d
Notes:
github-actions[bot]
2024-12-05 21:07:07 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/4f07cddb2d9 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2790 Reviewed-by: https://github.com/gmta ✅
3 changed files with 6 additions and 6 deletions
|
@ -405,8 +405,8 @@ ThrowCompletionOr<GC::Ref<Duration>> difference_temporal_plain_date_time(VM& vm,
|
|||
// 6. Let internalDuration be ? DifferencePlainDateTimeWithRounding(dateTime.[[ISODateTime]], other.[[ISODateTime]], dateTime.[[Calendar]], settings.[[LargestUnit]], settings.[[RoundingIncrement]], settings.[[SmallestUnit]], settings.[[RoundingMode]]).
|
||||
auto internal_duration = TRY(difference_plain_date_time_with_rounding(vm, date_time.iso_date_time(), other->iso_date_time(), date_time.calendar(), settings.largest_unit, settings.rounding_increment, settings.smallest_unit, settings.rounding_mode));
|
||||
|
||||
// 7. Let result be ? TemporalDurationFromInternal(internalDuration, settings.[[LargestUnit]]).
|
||||
auto result = TRY(temporal_duration_from_internal(vm, internal_duration, settings.largest_unit));
|
||||
// 7. Let result be ! TemporalDurationFromInternal(internalDuration, settings.[[LargestUnit]]).
|
||||
auto result = MUST(temporal_duration_from_internal(vm, internal_duration, settings.largest_unit));
|
||||
|
||||
// 8. If operation is SINCE, set result to CreateNegatedTemporalDuration(result).
|
||||
if (operation == DurationOperation::Since)
|
||||
|
|
|
@ -259,8 +259,8 @@ ThrowCompletionOr<GC::Ref<Duration>> difference_temporal_plain_year_month(VM& vm
|
|||
duration = TRY(round_relative_duration(vm, move(duration), dest_epoch_ns, iso_date_time, {}, calendar, settings.largest_unit, settings.rounding_increment, settings.smallest_unit, settings.rounding_mode));
|
||||
}
|
||||
|
||||
// 17. Let result be ? TemporalDurationFromInternal(duration, DAY).
|
||||
auto result = TRY(temporal_duration_from_internal(vm, duration, Unit::Day));
|
||||
// 17. Let result be ! TemporalDurationFromInternal(duration, DAY).
|
||||
auto result = MUST(temporal_duration_from_internal(vm, duration, Unit::Day));
|
||||
|
||||
// 18. If operation is SINCE, set result to CreateNegatedTemporalDuration(result).
|
||||
if (operation == DurationOperation::Since)
|
||||
|
|
|
@ -576,8 +576,8 @@ ThrowCompletionOr<GC::Ref<Duration>> difference_temporal_zoned_date_time(VM& vm,
|
|||
// 9. Let internalDuration be ? DifferenceZonedDateTimeWithRounding(zonedDateTime.[[EpochNanoseconds]], other.[[EpochNanoseconds]], zonedDateTime.[[TimeZone]], zonedDateTime.[[Calendar]], settings.[[LargestUnit]], settings.[[RoundingIncrement]], settings.[[SmallestUnit]], settings.[[RoundingMode]]).
|
||||
auto internal_duration = TRY(difference_zoned_date_time_with_rounding(vm, zoned_date_time.epoch_nanoseconds()->big_integer(), other->epoch_nanoseconds()->big_integer(), zoned_date_time.time_zone(), zoned_date_time.calendar(), settings.largest_unit, settings.rounding_increment, settings.smallest_unit, settings.rounding_mode));
|
||||
|
||||
// 10. Let result be ? TemporalDurationFromInternal(internalDuration, HOUR).
|
||||
auto result = TRY(temporal_duration_from_internal(vm, internal_duration, Unit::Hour));
|
||||
// 10. Let result be ! TemporalDurationFromInternal(internalDuration, HOUR).
|
||||
auto result = MUST(temporal_duration_from_internal(vm, internal_duration, Unit::Hour));
|
||||
|
||||
// 11. If operation is SINCE, set result to CreateNegatedTemporalDuration(result).
|
||||
if (operation == DurationOperation::Since)
|
||||
|
|
Loading…
Reference in a new issue