mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-30 13:19:47 +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:
@@ -36,9 +36,9 @@ void WebAssemblyObject::initialize(JS::Realm& realm)
|
||||
Object::initialize(realm);
|
||||
|
||||
u8 attr = JS::Attribute::Configurable | JS::Attribute::Writable | JS::Attribute::Enumerable;
|
||||
define_native_function("validate", validate, 1, attr);
|
||||
define_native_function("compile", compile, 1, attr);
|
||||
define_native_function("instantiate", instantiate, 1, attr);
|
||||
define_native_function(realm, "validate", validate, 1, attr);
|
||||
define_native_function(realm, "compile", compile, 1, attr);
|
||||
define_native_function(realm, "instantiate", instantiate, 1, attr);
|
||||
|
||||
auto& vm = this->vm();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user