1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 14:25:08 +00:00

LibJS: Use correct |this| value when getting/setting native properties

This commit is contained in:
Andreas Kling 2020-03-24 14:46:05 +01:00
parent 8705c5ffeb
commit 7dc78b5e38
4 changed files with 15 additions and 15 deletions

View file

@ -59,7 +59,7 @@ void Array::visit_children(Cell::Visitor& visitor)
visitor.visit(element);
}
Optional<Value> Array::get_own_property(const FlyString& property_name) const
Optional<Value> Array::get_own_property(const Object& this_object, const FlyString& property_name) const
{
bool ok;
i32 index = property_name.to_int(ok);
@ -67,10 +67,10 @@ Optional<Value> Array::get_own_property(const FlyString& property_name) const
if (index >= 0 && index < length())
return m_elements[index];
}
return Object::get_own_property(property_name);
return Object::get_own_property(this_object, property_name);
}
bool Array::put_own_property(const FlyString& property_name, Value value)
bool Array::put_own_property(Object& this_object, const FlyString& property_name, Value value)
{
bool ok;
i32 index = property_name.to_int(ok);
@ -80,7 +80,7 @@ bool Array::put_own_property(const FlyString& property_name, Value value)
m_elements[index] = value;
return true;
}
return Object::put_own_property(property_name, value);
return Object::put_own_property(this_object, property_name, value);
}
}