mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-24 11:21:34 +00:00
LibJS: Handle Unicode locale extensions in the ResolveLocale operation
Currently, all callers of ResolveLocale invoke the operation with an empty [[RelevantExtensionKeys]] slot, so the block of the method that deals with those keys was unimplemented. This implements that block now to prepare for Intl.NumberFormat which has a [[RelevantExtensionKeys]]. Note that the find_key_in_value() method is a simple VERIFY_NOT_REACHED in just this commit until the Intl.NumberFormat's keys are handled in its implementation.
This commit is contained in:
parent
e6334cb856
commit
a1954262f8
Notes:
sideshowbarker
2024-07-18 04:18:11 +09:00
Author: https://github.com/trflynn89
Commit: a1954262f8
Pull-request: https://github.com/SerenityOS/serenity/pull/9945
Reviewed-by: https://github.com/linusg ✅
2 changed files with 120 additions and 40 deletions
|
@ -24,6 +24,7 @@ struct LocaleOptions {
|
|||
|
||||
struct LocaleResult {
|
||||
String locale;
|
||||
String data_locale;
|
||||
};
|
||||
|
||||
struct PatternPartition {
|
||||
|
@ -42,7 +43,7 @@ Object* coerce_options_to_object(GlobalObject& global_object, Value options);
|
|||
Value get_option(GlobalObject& global_object, Value options, PropertyName const& property, Value::Type type, Vector<StringView> const& values, Fallback fallback);
|
||||
Vector<PatternPartition> partition_pattern(StringView pattern);
|
||||
String insert_unicode_extension_and_canonicalize(Unicode::LocaleID locale_id, Unicode::LocaleExtension extension);
|
||||
LocaleResult resolve_locale(Vector<String> const& requested_locales, LocaleOptions const& options, Vector<StringView> relevant_extension_keys);
|
||||
LocaleResult resolve_locale(Vector<String> const& requested_locales, LocaleOptions const& options, Vector<StringView> const& relevant_extension_keys);
|
||||
Value canonical_code_for_display_names(GlobalObject&, DisplayNames::Type type, StringView code);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue