diff options
author | Timothy Flynn <trflynn89@pm.me> | 2022-08-30 10:12:24 -0400 |
---|---|---|
committer | Tim Flynn <trflynn89@pm.me> | 2022-08-30 14:26:11 -0400 |
commit | 2fb332da7b10a3249be00cd8e947e1fbeb997cb2 (patch) | |
tree | 97c1385a7420d3df47f0801b542e948ac5de2bb6 /Userland/Libraries/LibJS | |
parent | cce9172cd42aa581206329d2a6aa825322f50bbe (diff) | |
download | serenity-2fb332da7b10a3249be00cd8e947e1fbeb997cb2.zip |
LibJS: Update spec steps to validate DurationFormat's numberingSystem
This is a normative change in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/63a9202
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp index 435159b43b..9d27011d7c 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2022, Idan Horowitz <idan.horowitz@serenityos.org> + * Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ @@ -63,10 +64,10 @@ ThrowCompletionOr<Object*> DurationFormatConstructor::construct(FunctionObject& // 6. Let numberingSystem be ? GetOption(options, "numberingSystem", "string", undefined, undefined). auto numbering_system = TRY(get_option(vm, *options, vm.names.numberingSystem, OptionType::String, {}, Empty {})); - // FIXME: Missing spec step - If numberingSystem is not undefined, then + // 7. If numberingSystem is not undefined, then if (!numbering_system.is_undefined()) { - // 7. If numberingSystem does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception. - if (numbering_system.is_undefined() || !Unicode::is_type_identifier(numbering_system.as_string().string())) + // a. If numberingSystem does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception. + if (!Unicode::is_type_identifier(numbering_system.as_string().string())) return vm.throw_completion<RangeError>(ErrorType::OptionIsNotValidValue, numbering_system, "numberingSystem"sv); } |