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:
Andreas Kling 2020-03-15 20:51:36 +01:00
commit 63b3cfdc73
Notes: sideshowbarker 2024-07-19 08:17:26 +09:00
9 changed files with 28 additions and 26 deletions

View file

@ -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; }