1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:27:35 +00:00

LibJS: Update to the latest ECMA-402 GetOption and move it into ECMA-262

This is an editorial change in the Temporal spec.

See: 4e79b69
This commit is contained in:
Linus Groh 2022-06-14 23:03:25 +01:00
parent 46d2ac6da4
commit 71a519831d
13 changed files with 90 additions and 119 deletions

View file

@ -88,13 +88,13 @@ ThrowCompletionOr<PluralRules*> initialize_plural_rules(GlobalObject& global_obj
LocaleOptions opt {};
// 4. Let matcher be ? GetOption(options, "localeMatcher", "string", « "lookup", "best fit" », "best fit").
auto matcher = TRY(get_option(global_object, *options, vm.names.localeMatcher, Value::Type::String, AK::Array { "lookup"sv, "best fit"sv }, "best fit"sv));
auto matcher = TRY(get_option(global_object, *options, vm.names.localeMatcher, OptionType::String, AK::Array { "lookup"sv, "best fit"sv }, "best fit"sv));
// 5. Set opt.[[localeMatcher]] to matcher.
opt.locale_matcher = matcher;
// 6. Let t be ? GetOption(options, "type", "string", « "cardinal", "ordinal" », "cardinal").
auto type = TRY(get_option(global_object, *options, vm.names.type, Value::Type::String, AK::Array { "cardinal"sv, "ordinal"sv }, "cardinal"sv));
auto type = TRY(get_option(global_object, *options, vm.names.type, OptionType::String, AK::Array { "cardinal"sv, "ordinal"sv }, "cardinal"sv));
// 7. Set pluralRules.[[Type]] to t.
plural_rules.set_type(type.as_string().string());