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:
parent
8705c5ffeb
commit
7dc78b5e38
4 changed files with 15 additions and 15 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue