1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:37:45 +00:00

LibJS: Port merge_largest_unit_option() to String

This commit is contained in:
Linus Groh 2023-01-26 14:07:33 +00:00
parent 918122c1e3
commit 654911444e
6 changed files with 9 additions and 9 deletions

View file

@ -1,6 +1,6 @@
/*
* Copyright (c) 2021, Idan Horowitz <idan.horowitz@serenityos.org>
* Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org>
* Copyright (c) 2021-2023, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -369,7 +369,7 @@ ThrowCompletionOr<DurationRecord> difference_iso_date_time(VM& vm, i32 year1, u8
auto date_largest_unit = larger_of_two_temporal_units("day"sv, largest_unit);
// 11. Let untilOptions be ? MergeLargestUnitOption(options, dateLargestUnit).
auto* until_options = TRY(merge_largest_unit_option(vm, options, date_largest_unit));
auto* until_options = TRY(merge_largest_unit_option(vm, options, TRY_OR_THROW_OOM(vm, String::from_utf8(date_largest_unit))));
// 12. Let dateDifference be ? CalendarDateUntil(calendar, date1, date2, untilOptions).
auto* date_difference = TRY(calendar_date_until(vm, calendar, date1, date2, *until_options));