mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
LibJS: Pass GlobalObject& to native functions and property accessors
More work towards supporting multiple global objects. Native C++ code now get a GlobalObject& and don't have to ask the Interpreter for it. I've added macros for declaring and defining native callbacks since this was pretty tedious and this makes it easier next time we want to change any of these signatures.
This commit is contained in:
parent
4aa98052ca
commit
e4add19915
Notes:
sideshowbarker
2024-07-19 05:32:11 +09:00
Author: https://github.com/awesomekling
Commit: e4add19915
79 changed files with 541 additions and 519 deletions
|
@ -130,7 +130,7 @@ Value ScriptFunction::construct(Interpreter& interpreter)
|
|||
return call(interpreter);
|
||||
}
|
||||
|
||||
Value ScriptFunction::length_getter(Interpreter& interpreter)
|
||||
JS_DEFINE_NATIVE_GETTER(ScriptFunction::length_getter)
|
||||
{
|
||||
auto* function = script_function_from(interpreter);
|
||||
if (!function)
|
||||
|
@ -138,7 +138,7 @@ Value ScriptFunction::length_getter(Interpreter& interpreter)
|
|||
return Value(static_cast<i32>(function->m_function_length));
|
||||
}
|
||||
|
||||
Value ScriptFunction::name_getter(Interpreter& interpreter)
|
||||
JS_DEFINE_NATIVE_GETTER(ScriptFunction::name_getter)
|
||||
{
|
||||
auto* function = script_function_from(interpreter);
|
||||
if (!function)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue