mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-08 10:36:02 +00:00
LibJS: Port merge_largest_unit_option() to String
This commit is contained in:
parent
918122c1e3
commit
654911444e
Notes:
sideshowbarker
2024-07-17 05:58:46 +09:00
Author: https://github.com/linusg
Commit: 654911444e
Pull-request: https://github.com/SerenityOS/serenity/pull/17186
Reviewed-by: https://github.com/trflynn89 ✅
6 changed files with 9 additions and 9 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue