mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:17:45 +00:00
LibJS: Port get_difference_settings() to String
Also make balance_duration() take a StringView as part of this, it only does equality checks.
This commit is contained in:
parent
227379a1da
commit
8f7c2f8292
8 changed files with 14 additions and 14 deletions
|
@ -510,7 +510,7 @@ ThrowCompletionOr<Duration*> difference_temporal_plain_date(VM& vm, DifferenceOp
|
|||
auto settings = TRY(get_difference_settings(vm, operation, options_value, UnitGroup::Date, {}, { "day"sv }, "day"sv));
|
||||
|
||||
// 5. Let untilOptions be ? MergeLargestUnitOption(settings.[[Options]], settings.[[LargestUnit]]).
|
||||
auto* until_options = TRY(merge_largest_unit_option(vm, settings.options, TRY_OR_THROW_OOM(vm, String::from_deprecated_string(settings.largest_unit))));
|
||||
auto* until_options = TRY(merge_largest_unit_option(vm, settings.options, move(settings.largest_unit)));
|
||||
|
||||
// 6. Let result be ? CalendarDateUntil(temporalDate.[[Calendar]], temporalDate, other, untilOptions).
|
||||
auto* duration = TRY(calendar_date_until(vm, temporal_date.calendar(), &temporal_date, other, *until_options));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue