LibJS: Define constructor slots for describing how to read options

This is an editorial change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/a2beb66

We implement this change by introducing a virtual interface that all
Intl "service" objects must implement. A future patch will make use of
the virtualized RelevantExtensionKeys and ResolutionOptionDescriptors
accessors, and we will need to be able to use those slots from a generic
instance type.
This commit is contained in:
Timothy Flynn
2025-04-07 15:56:31 -04:00
committed by Tim Flynn
parent 19ce186f97
commit 62793b1bd8
Notes: github-actions[bot] 2025-04-08 10:53:24 +00:00
29 changed files with 284 additions and 116 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2024, Tim Flynn <trflynn89@ladybird.org>
* Copyright (c) 2021-2025, Tim Flynn <trflynn89@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -145,7 +145,7 @@ ThrowCompletionOr<GC::Ref<DateTimeFormat>> create_date_time_format(VM& vm, Funct
opt.hc = locale_key_from_value(hour_cycle);
// 17. Let r be ResolveLocale(%Intl.DateTimeFormat%.[[AvailableLocales]], requestedLocales, opt, %Intl.DateTimeFormat%.[[RelevantExtensionKeys]], %Intl.DateTimeFormat%.[[LocaleData]]).
auto result = resolve_locale(requested_locales, opt, DateTimeFormat::relevant_extension_keys());
auto result = resolve_locale(requested_locales, opt, date_time_format->relevant_extension_keys());
// 18. Set dateTimeFormat.[[Locale]] to r.[[Locale]].
date_time_format->set_locale(move(result.locale));