mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +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:
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
|
@ -22,8 +22,8 @@ void AgentObject::initialize(JS::Realm& realm)
|
|||
Base::initialize(realm);
|
||||
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
define_native_function("monotonicNow", monotonic_now, 0, attr);
|
||||
define_native_function("sleep", sleep, 1, attr);
|
||||
define_native_function(realm, "monotonicNow", monotonic_now, 0, attr);
|
||||
define_native_function(realm, "sleep", sleep, 1, attr);
|
||||
// TODO: broadcast
|
||||
// TODO: getReport
|
||||
// TODO: start
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue