1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:28:12 +00:00

LibJS: Default to "short" for DurationFormat's style option

This is a normative change in the Intl.DurationFormat proposal. See:
b289494
This commit is contained in:
Timothy Flynn 2022-08-30 10:23:38 -04:00 committed by Tim Flynn
parent 765d016670
commit d57b92da09
4 changed files with 33 additions and 33 deletions

View file

@ -89,8 +89,8 @@ ThrowCompletionOr<Object*> DurationFormatConstructor::construct(FunctionObject&
if (result.nu.has_value())
duration_format->set_numbering_system(result.nu.release_value());
// 13. Let style be ? GetOption(options, "style", "string", « "long", "short", "narrow", "digital" », "long").
auto style = TRY(get_option(vm, *options, vm.names.style, OptionType::String, { "long"sv, "short"sv, "narrow"sv, "digital"sv }, "long"sv));
// 13. Let style be ? GetOption(options, "style", "string", « "long", "short", "narrow", "digital" », "short").
auto style = TRY(get_option(vm, *options, vm.names.style, OptionType::String, { "long"sv, "short"sv, "narrow"sv, "digital"sv }, "short"sv));
// 14. Set durationFormat.[[Style]] to style.
duration_format->set_style(style.as_string().string());