mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user