1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:28:11 +00:00

LibJS: Only set receiver value fallback once in Object::get()

This commit is contained in:
Linus Groh 2021-03-16 21:59:49 +01:00 committed by Andreas Kling
parent 8533cceed5
commit 4f36b6bfbd

View file

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