mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-04 12:34:22 +00:00
LibJS: Pass "this" as an Object* to NativeFunction callbacks
Instead of every NativeFunction callback having to ask the Interpreter for the current "this" value and then converting it to an Object etc, just pass "this" as an Object* directly.
This commit is contained in:
@@ -63,7 +63,7 @@ void Object::put(String property_name, Value value)
|
||||
m_properties.set(property_name, move(value));
|
||||
}
|
||||
|
||||
void Object::put_native_function(String property_name, AK::Function<Value(Interpreter&, Vector<Value>)> native_function)
|
||||
void Object::put_native_function(String property_name, AK::Function<Value(Object*, Vector<Value>)> native_function)
|
||||
{
|
||||
put(property_name, heap().allocate<NativeFunction>(move(native_function)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user