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:
parent
7c468b5a77
commit
e3895e6c80
Notes:
sideshowbarker
2024-07-17 07:52:52 +09:00
Author: https://github.com/linusg
Commit: e3895e6c80
Pull-request: https://github.com/SerenityOS/serenity/pull/14973
Reviewed-by: https://github.com/davidot ✅
116 changed files with 893 additions and 890 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue