From ddd5d8531bdd36ab9a7315b602046fc683afa37b Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Thu, 26 Jan 2023 12:19:55 +0000 Subject: LibJS: Port to_time_zone_name_option() to String --- Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp | 4 ++-- Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'Userland/Libraries') diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp index 11d585d775..35164ea7ea 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp @@ -254,13 +254,13 @@ ThrowCompletionOr to_calendar_name_option(VM& vm, Object const& normaliz } // 13.10 ToTimeZoneNameOption ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-totimezonenameoption -ThrowCompletionOr to_time_zone_name_option(VM& vm, Object const& normalized_options) +ThrowCompletionOr to_time_zone_name_option(VM& vm, Object const& normalized_options) { // 1. Return ? GetOption(normalizedOptions, "timeZoneName", "string", « "auto", "never", "critical" », "auto"). auto option = TRY(get_option(vm, normalized_options, vm.names.timeZoneName, OptionType::String, { "auto"sv, "never"sv, "critical"sv }, "auto"sv)); VERIFY(option.is_string()); - return TRY(option.as_string().deprecated_string()); + return option.as_string().utf8_string(); } // 13.11 ToShowOffsetOption ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-toshowoffsetoption diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h index 96f5c8db6d..6dcaebffb7 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h @@ -141,7 +141,7 @@ ThrowCompletionOr to_temporal_rounding_mode(VM&, Object const& normalize StringView negate_temporal_rounding_mode(StringView rounding_mode); ThrowCompletionOr to_temporal_offset(VM&, Object const* options, StringView fallback); ThrowCompletionOr to_calendar_name_option(VM&, Object const& normalized_options); -ThrowCompletionOr to_time_zone_name_option(VM&, Object const& normalized_options); +ThrowCompletionOr to_time_zone_name_option(VM&, Object const& normalized_options); ThrowCompletionOr to_show_offset_option(VM&, Object const& normalized_options); ThrowCompletionOr to_temporal_rounding_increment(VM&, Object const& normalized_options, Optional dividend, bool inclusive); ThrowCompletionOr to_temporal_date_time_rounding_increment(VM&, Object const& normalized_options, StringView smallest_unit); -- cgit v1.2.3