diff --git a/Libraries/LibJS/Runtime/NativeProperty.cpp b/Libraries/LibJS/Runtime/NativeProperty.cpp index 50487fde7a..95cebf903b 100644 --- a/Libraries/LibJS/Runtime/NativeProperty.cpp +++ b/Libraries/LibJS/Runtime/NativeProperty.cpp @@ -40,18 +40,18 @@ NativeProperty::~NativeProperty() { } -Value NativeProperty::get(Interpreter& interpreter) const +Value NativeProperty::get(Interpreter& interpreter, GlobalObject& global_object) const { if (!m_getter) return js_undefined(); - return m_getter(interpreter, global_object()); + return m_getter(interpreter, global_object); } -void NativeProperty::set(Interpreter& interpreter, Value value) +void NativeProperty::set(Interpreter& interpreter, GlobalObject& global_object, Value value) { if (!m_setter) return; - m_setter(interpreter, global_object(), move(value)); + m_setter(interpreter, global_object, move(value)); } } diff --git a/Libraries/LibJS/Runtime/NativeProperty.h b/Libraries/LibJS/Runtime/NativeProperty.h index e98d9a91e7..52bd5cc125 100644 --- a/Libraries/LibJS/Runtime/NativeProperty.h +++ b/Libraries/LibJS/Runtime/NativeProperty.h @@ -36,8 +36,8 @@ public: NativeProperty(AK::Function getter, AK::Function setter); virtual ~NativeProperty() override; - Value get(Interpreter&) const; - void set(Interpreter&, Value); + Value get(Interpreter&, GlobalObject&) const; + void set(Interpreter&, GlobalObject&, Value); private: virtual bool is_native_property() const override { return true; } diff --git a/Libraries/LibJS/Runtime/Object.cpp b/Libraries/LibJS/Runtime/Object.cpp index 72c5dc8e6f..bfcaa7314e 100644 --- a/Libraries/LibJS/Runtime/Object.cpp +++ b/Libraries/LibJS/Runtime/Object.cpp @@ -808,7 +808,7 @@ Value Object::call_native_property_getter(Object* this_object, Value property) c auto& native_property = static_cast(property.as_object()); auto& call_frame = interpreter().push_call_frame(); call_frame.this_value = this_object; - auto result = native_property.get(interpreter()); + auto result = native_property.get(interpreter(), global_object()); interpreter().pop_call_frame(); return result; } @@ -820,7 +820,7 @@ void Object::call_native_property_setter(Object* this_object, Value property, Va auto& native_property = static_cast(property.as_object()); auto& call_frame = interpreter().push_call_frame(); call_frame.this_value = this_object; - native_property.set(interpreter(), value); + native_property.set(interpreter(), global_object(), value); interpreter().pop_call_frame(); }