diff options
author | Linus Groh <mail@linusgroh.de> | 2022-08-22 21:47:35 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-08-23 13:58:30 +0100 |
commit | e3895e6c808d4606f02b26b1eaad3a3a803bba12 (patch) | |
tree | e3fe097d28b10f984df6cd67ca987a743cede389 /Userland/Libraries/LibJS/Runtime/ReflectObject.cpp | |
parent | 7c468b5a772342243d1b306389c34ce485033392 (diff) | |
download | serenity-e3895e6c808d4606f02b26b1eaad3a3a803bba12.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/ReflectObject.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/ReflectObject.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp b/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp index cbe5cfc629..8c74732106 100644 --- a/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp @@ -25,19 +25,19 @@ void ReflectObject::initialize(Realm& realm) auto& vm = this->vm(); Object::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.apply, apply, 3, attr); - define_native_function(vm.names.construct, construct, 2, attr); - define_native_function(vm.names.defineProperty, define_property, 3, attr); - define_native_function(vm.names.deleteProperty, delete_property, 2, attr); - define_native_function(vm.names.get, get, 2, attr); - define_native_function(vm.names.getOwnPropertyDescriptor, get_own_property_descriptor, 2, attr); - define_native_function(vm.names.getPrototypeOf, get_prototype_of, 1, attr); - define_native_function(vm.names.has, has, 2, attr); - define_native_function(vm.names.isExtensible, is_extensible, 1, attr); - define_native_function(vm.names.ownKeys, own_keys, 1, attr); - define_native_function(vm.names.preventExtensions, prevent_extensions, 1, attr); - define_native_function(vm.names.set, set, 3, attr); - define_native_function(vm.names.setPrototypeOf, set_prototype_of, 2, attr); + define_native_function(realm, vm.names.apply, apply, 3, attr); + define_native_function(realm, vm.names.construct, construct, 2, attr); + define_native_function(realm, vm.names.defineProperty, define_property, 3, attr); + define_native_function(realm, vm.names.deleteProperty, delete_property, 2, attr); + define_native_function(realm, vm.names.get, get, 2, attr); + define_native_function(realm, vm.names.getOwnPropertyDescriptor, get_own_property_descriptor, 2, attr); + define_native_function(realm, vm.names.getPrototypeOf, get_prototype_of, 1, attr); + define_native_function(realm, vm.names.has, has, 2, attr); + define_native_function(realm, vm.names.isExtensible, is_extensible, 1, attr); + define_native_function(realm, vm.names.ownKeys, own_keys, 1, attr); + define_native_function(realm, vm.names.preventExtensions, prevent_extensions, 1, attr); + define_native_function(realm, vm.names.set, set, 3, attr); + define_native_function(realm, vm.names.setPrototypeOf, set_prototype_of, 2, attr); // 28.1.14 Reflect [ @@toStringTag ], https://tc39.es/ecma262/#sec-reflect-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, vm.names.Reflect.as_string()), Attribute::Configurable); |