mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00:00
LibJS: Only set receiver value fallback once in Object::get()
This commit is contained in:
parent
8533cceed5
commit
4f36b6bfbd
Notes:
sideshowbarker
2024-07-18 21:17:09 +09:00
Author: https://github.com/linusg
Commit: 4f36b6bfbd
Pull-request: https://github.com/SerenityOS/serenity/pull/5835
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);
|
return get_by_index(property_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (receiver.is_empty())
|
||||||
|
receiver = Value(this);
|
||||||
|
|
||||||
const Object* object = this;
|
const Object* object = this;
|
||||||
while (object) {
|
while (object) {
|
||||||
if (receiver.is_empty())
|
|
||||||
receiver = Value(const_cast<Object*>(this));
|
|
||||||
auto value = object->get_own_property(property_name, receiver);
|
auto value = object->get_own_property(property_name, receiver);
|
||||||
if (vm().exception())
|
if (vm().exception())
|
||||||
return {};
|
return {};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue