1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:17:44 +00:00

LibJS: Pass Realm to define_native_{accessor,function}()

This is needed so that the allocated NativeFunction receives the correct
realm, usually forwarded from the Object's initialize() function, rather
than using the current realm.
This commit is contained in:
Linus Groh 2022-08-22 21:47:35 +01:00
parent 7c468b5a77
commit e3895e6c80
116 changed files with 893 additions and 890 deletions

View file

@ -54,8 +54,8 @@ void Intl::initialize(Realm& realm)
define_direct_property(vm.names.RelativeTimeFormat, realm.global_object().intl_relative_time_format_constructor(), attr);
define_direct_property(vm.names.Segmenter, realm.global_object().intl_segmenter_constructor(), attr);
define_native_function(vm.names.getCanonicalLocales, get_canonical_locales, 1, attr);
define_native_function(vm.names.supportedValuesOf, supported_values_of, 1, attr);
define_native_function(realm, vm.names.getCanonicalLocales, get_canonical_locales, 1, attr);
define_native_function(realm, vm.names.supportedValuesOf, supported_values_of, 1, attr);
}
// 8.3.1 Intl.getCanonicalLocales ( locales ), https://tc39.es/ecma402/#sec-intl.getcanonicallocales