mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
LibJS: Port to_calendar_name_option() to String
This commit is contained in:
parent
a387b22599
commit
0435156a86
Notes:
sideshowbarker
2024-07-17 04:34:25 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/0435156a86 Pull-request: https://github.com/SerenityOS/serenity/pull/17186 Reviewed-by: https://github.com/trflynn89 ✅
@ -244,13 +244,13 @@ ThrowCompletionOr<String> to_temporal_offset(VM& vm, Object const* options, Stri
|
||||
}
|
||||
|
||||
// 13.9 ToCalendarNameOption ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-tocalendarnameoption
|
||||
ThrowCompletionOr<DeprecatedString> to_calendar_name_option(VM& vm, Object const& normalized_options)
|
||||
ThrowCompletionOr<String> to_calendar_name_option(VM& vm, Object const& normalized_options)
|
||||
{
|
||||
// 1. Return ? GetOption(normalizedOptions, "calendarName", "string", « "auto", "always", "never", "critical" », "auto").
|
||||
auto option = TRY(get_option(vm, normalized_options, vm.names.calendarName, OptionType::String, { "auto"sv, "always"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.10 ToTimeZoneNameOption ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-totimezonenameoption
|
||||
|
@ -140,7 +140,7 @@ ThrowCompletionOr<String> to_temporal_disambiguation(VM&, Object const* options)
|
||||
ThrowCompletionOr<String> to_temporal_rounding_mode(VM&, Object const& normalized_options, StringView fallback);
|
||||
StringView negate_temporal_rounding_mode(StringView rounding_mode);
|
||||
ThrowCompletionOr<String> to_temporal_offset(VM&, Object const* options, StringView fallback);
|
||||
ThrowCompletionOr<DeprecatedString> to_calendar_name_option(VM&, Object const& normalized_options);
|
||||
ThrowCompletionOr<String> to_calendar_name_option(VM&, Object const& normalized_options);
|
||||
ThrowCompletionOr<DeprecatedString> to_time_zone_name_option(VM&, Object const& normalized_options);
|
||||
ThrowCompletionOr<DeprecatedString> to_show_offset_option(VM&, Object const& normalized_options);
|
||||
ThrowCompletionOr<u64> to_temporal_rounding_increment(VM&, Object const& normalized_options, Optional<double> dividend, bool inclusive);
|
||||
|
Loading…
Reference in New Issue
Block a user