mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-01 14:18: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:
@@ -122,7 +122,9 @@ void Worker::run_a_worker(AK::URL& url, EnvironmentSettingsObject& outside_setti
|
||||
// FIXME: This should be done with IDL
|
||||
u8 attr = JS::Attribute::Writable | JS::Attribute::Enumerable | JS::Attribute::Configurable;
|
||||
m_worker_scope->define_native_function(
|
||||
"postMessage", [this](auto& vm) {
|
||||
m_worker_scope->shape().realm(),
|
||||
"postMessage",
|
||||
[this](auto& vm) {
|
||||
// This is the implementation of the function that the spawned worked calls
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/workers.html#dom-dedicatedworkerglobalscope-postmessage
|
||||
|
||||
Reference in New Issue
Block a user