mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57: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:
parent
7c468b5a77
commit
e3895e6c80
116 changed files with 893 additions and 890 deletions
|
@ -31,28 +31,28 @@ void ObjectConstructor::initialize(Realm& realm)
|
|||
define_direct_property(vm.names.prototype, realm.global_object().object_prototype(), 0);
|
||||
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
define_native_function(vm.names.defineProperty, define_property, 3, attr);
|
||||
define_native_function(vm.names.defineProperties, define_properties, 2, attr);
|
||||
define_native_function(vm.names.is, is, 2, attr);
|
||||
define_native_function(vm.names.getOwnPropertyDescriptor, get_own_property_descriptor, 2, attr);
|
||||
define_native_function(vm.names.getOwnPropertyDescriptors, get_own_property_descriptors, 1, attr);
|
||||
define_native_function(vm.names.getOwnPropertyNames, get_own_property_names, 1, attr);
|
||||
define_native_function(vm.names.getOwnPropertySymbols, get_own_property_symbols, 1, attr);
|
||||
define_native_function(vm.names.getPrototypeOf, get_prototype_of, 1, attr);
|
||||
define_native_function(vm.names.setPrototypeOf, set_prototype_of, 2, attr);
|
||||
define_native_function(vm.names.isExtensible, is_extensible, 1, attr);
|
||||
define_native_function(vm.names.isFrozen, is_frozen, 1, attr);
|
||||
define_native_function(vm.names.isSealed, is_sealed, 1, attr);
|
||||
define_native_function(vm.names.preventExtensions, prevent_extensions, 1, attr);
|
||||
define_native_function(vm.names.freeze, freeze, 1, attr);
|
||||
define_native_function(vm.names.fromEntries, from_entries, 1, attr);
|
||||
define_native_function(vm.names.seal, seal, 1, attr);
|
||||
define_native_function(vm.names.keys, keys, 1, attr);
|
||||
define_native_function(vm.names.values, values, 1, attr);
|
||||
define_native_function(vm.names.entries, entries, 1, attr);
|
||||
define_native_function(vm.names.create, create, 2, attr);
|
||||
define_native_function(vm.names.hasOwn, has_own, 2, attr);
|
||||
define_native_function(vm.names.assign, assign, 2, attr);
|
||||
define_native_function(realm, vm.names.defineProperty, define_property, 3, attr);
|
||||
define_native_function(realm, vm.names.defineProperties, define_properties, 2, attr);
|
||||
define_native_function(realm, vm.names.is, is, 2, attr);
|
||||
define_native_function(realm, vm.names.getOwnPropertyDescriptor, get_own_property_descriptor, 2, attr);
|
||||
define_native_function(realm, vm.names.getOwnPropertyDescriptors, get_own_property_descriptors, 1, attr);
|
||||
define_native_function(realm, vm.names.getOwnPropertyNames, get_own_property_names, 1, attr);
|
||||
define_native_function(realm, vm.names.getOwnPropertySymbols, get_own_property_symbols, 1, attr);
|
||||
define_native_function(realm, vm.names.getPrototypeOf, get_prototype_of, 1, attr);
|
||||
define_native_function(realm, vm.names.setPrototypeOf, set_prototype_of, 2, attr);
|
||||
define_native_function(realm, vm.names.isExtensible, is_extensible, 1, attr);
|
||||
define_native_function(realm, vm.names.isFrozen, is_frozen, 1, attr);
|
||||
define_native_function(realm, vm.names.isSealed, is_sealed, 1, attr);
|
||||
define_native_function(realm, vm.names.preventExtensions, prevent_extensions, 1, attr);
|
||||
define_native_function(realm, vm.names.freeze, freeze, 1, attr);
|
||||
define_native_function(realm, vm.names.fromEntries, from_entries, 1, attr);
|
||||
define_native_function(realm, vm.names.seal, seal, 1, attr);
|
||||
define_native_function(realm, vm.names.keys, keys, 1, attr);
|
||||
define_native_function(realm, vm.names.values, values, 1, attr);
|
||||
define_native_function(realm, vm.names.entries, entries, 1, attr);
|
||||
define_native_function(realm, vm.names.create, create, 2, attr);
|
||||
define_native_function(realm, vm.names.hasOwn, has_own, 2, attr);
|
||||
define_native_function(realm, vm.names.assign, assign, 2, attr);
|
||||
|
||||
define_direct_property(vm.names.length, Value(1), Attribute::Configurable);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue