1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:37:35 +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

@ -253,14 +253,14 @@ void PromiseConstructor::initialize(Realm& realm)
define_direct_property(vm.names.prototype, realm.global_object().promise_prototype(), 0);
u8 attr = Attribute::Writable | Attribute::Configurable;
define_native_function(vm.names.all, all, 1, attr);
define_native_function(vm.names.allSettled, all_settled, 1, attr);
define_native_function(vm.names.any, any, 1, attr);
define_native_function(vm.names.race, race, 1, attr);
define_native_function(vm.names.reject, reject, 1, attr);
define_native_function(vm.names.resolve, resolve, 1, attr);
define_native_function(realm, vm.names.all, all, 1, attr);
define_native_function(realm, vm.names.allSettled, all_settled, 1, attr);
define_native_function(realm, vm.names.any, any, 1, attr);
define_native_function(realm, vm.names.race, race, 1, attr);
define_native_function(realm, vm.names.reject, reject, 1, attr);
define_native_function(realm, vm.names.resolve, resolve, 1, attr);
define_native_accessor(*vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable);
define_native_accessor(realm, *vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable);
define_direct_property(vm.names.length, Value(1), Attribute::Configurable);
}