1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09: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
Notes: sideshowbarker 2024-07-17 07:52:52 +09:00
116 changed files with 893 additions and 890 deletions

View file

@ -133,16 +133,16 @@ void AtomicsObject::initialize(Realm& realm)
auto& vm = this->vm();
u8 attr = Attribute::Writable | Attribute::Configurable;
define_native_function(vm.names.add, add, 3, attr);
define_native_function(vm.names.and_, and_, 3, attr);
define_native_function(vm.names.compareExchange, compare_exchange, 4, attr);
define_native_function(vm.names.exchange, exchange, 3, attr);
define_native_function(vm.names.isLockFree, is_lock_free, 1, attr);
define_native_function(vm.names.load, load, 2, attr);
define_native_function(vm.names.or_, or_, 3, attr);
define_native_function(vm.names.store, store, 3, attr);
define_native_function(vm.names.sub, sub, 3, attr);
define_native_function(vm.names.xor_, xor_, 3, attr);
define_native_function(realm, vm.names.add, add, 3, attr);
define_native_function(realm, vm.names.and_, and_, 3, attr);
define_native_function(realm, vm.names.compareExchange, compare_exchange, 4, attr);
define_native_function(realm, vm.names.exchange, exchange, 3, attr);
define_native_function(realm, vm.names.isLockFree, is_lock_free, 1, attr);
define_native_function(realm, vm.names.load, load, 2, attr);
define_native_function(realm, vm.names.or_, or_, 3, attr);
define_native_function(realm, vm.names.store, store, 3, attr);
define_native_function(realm, vm.names.sub, sub, 3, attr);
define_native_function(realm, vm.names.xor_, xor_, 3, attr);
// 25.4.15 Atomics [ @@toStringTag ], https://tc39.es/ecma262/#sec-atomics-@@tostringtag
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Atomics"), Attribute::Configurable);