mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +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
|
@ -22,22 +22,22 @@ void ConsoleObject::initialize(Realm& realm)
|
|||
auto& vm = this->vm();
|
||||
Object::initialize(realm);
|
||||
u8 attr = Attribute::Writable | Attribute::Enumerable | Attribute::Configurable;
|
||||
define_native_function(vm.names.log, log, 0, attr);
|
||||
define_native_function(vm.names.debug, debug, 0, attr);
|
||||
define_native_function(vm.names.info, info, 0, attr);
|
||||
define_native_function(vm.names.warn, warn, 0, attr);
|
||||
define_native_function(vm.names.error, error, 0, attr);
|
||||
define_native_function(vm.names.trace, trace, 0, attr);
|
||||
define_native_function(vm.names.count, count, 0, attr);
|
||||
define_native_function(vm.names.countReset, count_reset, 0, attr);
|
||||
define_native_function(vm.names.clear, clear, 0, attr);
|
||||
define_native_function(vm.names.assert, assert_, 0, attr);
|
||||
define_native_function(vm.names.group, group, 0, attr);
|
||||
define_native_function(vm.names.groupCollapsed, group_collapsed, 0, attr);
|
||||
define_native_function(vm.names.groupEnd, group_end, 0, attr);
|
||||
define_native_function(vm.names.time, time, 0, attr);
|
||||
define_native_function(vm.names.timeLog, time_log, 0, attr);
|
||||
define_native_function(vm.names.timeEnd, time_end, 0, attr);
|
||||
define_native_function(realm, vm.names.log, log, 0, attr);
|
||||
define_native_function(realm, vm.names.debug, debug, 0, attr);
|
||||
define_native_function(realm, vm.names.info, info, 0, attr);
|
||||
define_native_function(realm, vm.names.warn, warn, 0, attr);
|
||||
define_native_function(realm, vm.names.error, error, 0, attr);
|
||||
define_native_function(realm, vm.names.trace, trace, 0, attr);
|
||||
define_native_function(realm, vm.names.count, count, 0, attr);
|
||||
define_native_function(realm, vm.names.countReset, count_reset, 0, attr);
|
||||
define_native_function(realm, vm.names.clear, clear, 0, attr);
|
||||
define_native_function(realm, vm.names.assert, assert_, 0, attr);
|
||||
define_native_function(realm, vm.names.group, group, 0, attr);
|
||||
define_native_function(realm, vm.names.groupCollapsed, group_collapsed, 0, attr);
|
||||
define_native_function(realm, vm.names.groupEnd, group_end, 0, attr);
|
||||
define_native_function(realm, vm.names.time, time, 0, attr);
|
||||
define_native_function(realm, vm.names.timeLog, time_log, 0, attr);
|
||||
define_native_function(realm, vm.names.timeEnd, time_end, 0, attr);
|
||||
}
|
||||
|
||||
// 1.1.6. log(...data), https://console.spec.whatwg.org/#log
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue