diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp index 87f5bf4405..51798da666 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp @@ -238,7 +238,7 @@ bool is_valid_duration_record(Temporal::DurationRecord const& record) } // 1.1.6 GetDurationUnitOptions ( unit, options, baseStyle, stylesList, digitalBase, prevStyle ), https://tc39.es/proposal-intl-duration-format/#sec-getdurationunitoptions -ThrowCompletionOr get_duration_unit_options(VM& vm, String const& unit, Object const& options, StringView base_style, Span styles_list, StringView digital_base, Optional const& previous_style) +ThrowCompletionOr get_duration_unit_options(VM& vm, String const& unit, Object const& options, StringView base_style, Span styles_list, StringView digital_base, StringView previous_style) { // 1. Let style be ? GetOption(options, unit, "string", stylesList, undefined). auto style_value = TRY(get_option(vm, options, unit, OptionType::String, styles_list, Empty {})); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.h b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.h index 43f4f2e2e0..f16f4a72a6 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2022, Idan Horowitz + * Copyright (c) 2022, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ @@ -222,7 +223,7 @@ struct DurationUnitOptions { ThrowCompletionOr to_duration_record(VM&, Value input); i8 duration_sign(Temporal::DurationRecord const&); bool is_valid_duration_record(Temporal::DurationRecord const&); -ThrowCompletionOr get_duration_unit_options(VM&, String const& unit, Object const& options, StringView base_style, Span styles_list, StringView digital_base, Optional const& previous_style); +ThrowCompletionOr get_duration_unit_options(VM&, String const& unit, Object const& options, StringView base_style, Span styles_list, StringView digital_base, StringView previous_style); ThrowCompletionOr> partition_duration_format_pattern(VM&, DurationFormat const&, Temporal::DurationRecord const& duration); } diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp index 5cede348cf..5419e3b7ae 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp @@ -98,8 +98,8 @@ ThrowCompletionOr DurationFormatConstructor::construct(FunctionObject& // 15. Set durationFormat.[[DataLocale]] to r.[[dataLocale]]. duration_format->set_data_locale(move(result.data_locale)); - // 16. Let prevStyle be undefined. - Optional previous_style; + // 16. Let prevStyle be the empty String. + auto previous_style = String::empty(); // 17. For each row in Table 1, except the header row, in table order, do for (auto const& duration_instances_component : duration_instances_components) {