mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +00:00
LibJS: Only set receiver value fallback once in Object::get()
This commit is contained in:
parent
8533cceed5
commit
4f36b6bfbd
1 changed files with 3 additions and 2 deletions
|
@ -696,10 +696,11 @@ Value Object::get(const PropertyName& property_name, Value receiver) const
|
|||
return get_by_index(property_index);
|
||||
}
|
||||
|
||||
if (receiver.is_empty())
|
||||
receiver = Value(this);
|
||||
|
||||
const Object* object = this;
|
||||
while (object) {
|
||||
if (receiver.is_empty())
|
||||
receiver = Value(const_cast<Object*>(this));
|
||||
auto value = object->get_own_property(property_name, receiver);
|
||||
if (vm().exception())
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue