mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +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:
@@ -206,6 +206,7 @@ inline void TestRunnerGlobalObject::initialize_global_object(JS::Realm& realm)
|
||||
define_direct_property("global", this, JS::Attribute::Enumerable);
|
||||
for (auto& entry : s_exposed_global_functions) {
|
||||
define_native_function(
|
||||
realm,
|
||||
entry.key, [fn = entry.value.function](auto& vm) {
|
||||
return fn(vm);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user