aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4object.cpp')
-rw-r--r--src/qml/jsruntime/qv4object.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp
index cd9ea66297..c1f6642c9d 100644
--- a/src/qml/jsruntime/qv4object.cpp
+++ b/src/qml/jsruntime/qv4object.cpp
@@ -717,12 +717,13 @@ bool Object::virtualHasProperty(const Managed *m, PropertyKey id)
Scope scope(m->engine());
ScopedObject o(scope, m);
ScopedProperty p(scope);
- while (o) {
- if (o->getOwnProperty(id, p) != Attr_Invalid)
- return true;
- o = o->getPrototypeOf();
- }
+ if (o->getOwnProperty(id, p) != Attr_Invalid)
+ return true;
+
+ o = o->getPrototypeOf();
+ if (o)
+ return o->hasProperty(id);
return false;
}