mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:57:44 +00:00
LibJS: Update syntax for invoking the GetOption AO from Intl objects
This is an editorial change in the ECMA-402 spec. See:
0ac2e10
This commit is contained in:
parent
2cca5d6676
commit
95cef87a9c
12 changed files with 73 additions and 72 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org>
|
||||
* Copyright (c) 2022-2023, Tim Flynn <trflynn89@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -84,13 +84,13 @@ ThrowCompletionOr<PluralRules*> initialize_plural_rules(VM& vm, PluralRules& plu
|
|||
// 3. Let opt be a new Record.
|
||||
LocaleOptions opt {};
|
||||
|
||||
// 4. Let matcher be ? GetOption(options, "localeMatcher", "string", « "lookup", "best fit" », "best fit").
|
||||
// 4. Let matcher be ? GetOption(options, "localeMatcher", string, « "lookup", "best fit" », "best fit").
|
||||
auto matcher = TRY(get_option(vm, *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").
|
||||
// 6. Let t be ? GetOption(options, "type", string, « "cardinal", "ordinal" », "cardinal").
|
||||
auto type = TRY(get_option(vm, *options, vm.names.type, OptionType::String, AK::Array { "cardinal"sv, "ordinal"sv }, "cardinal"sv));
|
||||
|
||||
// 7. Set pluralRules.[[Type]] to t.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue