mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:38:11 +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:
parent
3163929990
commit
63b3cfdc73
9 changed files with 28 additions and 26 deletions
|
@ -41,7 +41,7 @@ public:
|
|||
Value get(String property_name) const;
|
||||
void put(String property_name, Value);
|
||||
|
||||
void put_native_function(String property_name, AK::Function<Value(Interpreter&, Vector<Value>)>);
|
||||
void put_native_function(String property_name, AK::Function<Value(Object*, Vector<Value>)>);
|
||||
void put_native_property(String property_name, AK::Function<Value(Object*)> getter, AK::Function<void(Object*, Value)> setter);
|
||||
|
||||
virtual bool is_function() const { return false; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue