1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:57:45 +00:00

LibJS: Add [[LanguageDisplay]] to Intl.DisplayNames's resolvedOptions

This commit is contained in:
Timothy Flynn 2022-01-12 14:18:22 -05:00 committed by Linus Groh
parent 27c845eef2
commit 1a3e6e8a7b
2 changed files with 56 additions and 0 deletions

View file

@ -116,6 +116,10 @@ JS_DEFINE_NATIVE_FUNCTION(DisplayNamesPrototype::resolved_options)
MUST(options->create_data_property_or_throw(vm.names.type, js_string(vm, display_names->type_string())));
MUST(options->create_data_property_or_throw(vm.names.fallback, js_string(vm, display_names->fallback_string())));
// NOTE: Step 4c indicates languageDisplay must not be undefined, but it is only set when the type option is language.
if (display_names->has_language_display())
MUST(options->create_data_property_or_throw(vm.names.languageDisplay, js_string(vm, display_names->language_display_string())));
// 5. Return options.
return options;
}