diff options
author | Timothy Flynn <trflynn89@pm.me> | 2022-03-15 10:43:33 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-15 17:30:58 +0100 |
commit | d6868d1e9deb7c376c87b750c854f1088c125421 (patch) | |
tree | 3c2c4d9d9b88bcc27b5c925fb40e408bf1ab0894 /Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp | |
parent | 6677e03a52a02259cb28669ab00f42c1b9d41be7 (diff) | |
download | serenity-d6868d1e9deb7c376c87b750c854f1088c125421.zip |
LibJS: Reorganize spec steps for Intl.Locale
This is an editorial change in the Intl spec:
https://github.com/tc39/ecma402/commit/31f6003
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp index 071d7dc742..30d315e4f3 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Tim Flynn <trflynn89@serenityos.org> + * Copyright (c) 2021-2022, Tim Flynn <trflynn89@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ @@ -40,7 +40,7 @@ static ThrowCompletionOr<Optional<String>> get_string_option(GlobalObject& globa return option.as_string().string(); } -// 14.1.1 ApplyOptionsToTag ( tag, options ), https://tc39.es/ecma402/#sec-apply-options-to-tag +// 14.1.2 ApplyOptionsToTag ( tag, options ), https://tc39.es/ecma402/#sec-apply-options-to-tag static ThrowCompletionOr<String> apply_options_to_tag(GlobalObject& global_object, StringView tag, Object const& options) { auto& vm = global_object.vm(); @@ -107,7 +107,7 @@ static ThrowCompletionOr<String> apply_options_to_tag(GlobalObject& global_objec return JS::Intl::canonicalize_unicode_locale_id(*locale_id); } -// 14.1.2 ApplyUnicodeExtensionToTag ( tag, options, relevantExtensionKeys ), https://tc39.es/ecma402/#sec-apply-unicode-extension-to-tag +// 14.1.3 ApplyUnicodeExtensionToTag ( tag, options, relevantExtensionKeys ), https://tc39.es/ecma402/#sec-apply-unicode-extension-to-tag static LocaleAndKeys apply_unicode_extension_to_tag(StringView tag, LocaleAndKeys options, Span<StringView const> relevant_extension_keys) { // 1. Assert: Type(tag) is String. @@ -236,14 +236,14 @@ void LocaleConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.length, Value(1), Attribute::Configurable); } -// 14.1.3 Intl.Locale ( tag [ , options ] ), https://tc39.es/ecma402/#sec-Intl.Locale +// 14.1.1 Intl.Locale ( tag [ , options ] ), https://tc39.es/ecma402/#sec-Intl.Locale ThrowCompletionOr<Value> LocaleConstructor::call() { // 1. If NewTarget is undefined, throw a TypeError exception. return vm().throw_completion<TypeError>(global_object(), ErrorType::ConstructorWithoutNew, "Intl.Locale"); } -// 14.1.3 Intl.Locale ( tag [ , options ] ), https://tc39.es/ecma402/#sec-Intl.Locale +// 14.1.1 Intl.Locale ( tag [ , options ] ), https://tc39.es/ecma402/#sec-Intl.Locale ThrowCompletionOr<Object*> LocaleConstructor::construct(FunctionObject& new_target) { auto& vm = this->vm(); |