aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4objectiterator.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-08-03 10:06:52 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-08-04 09:16:33 +0000
commit895a3f08b4feade6b377c1818a7fff9b0b1052c6 (patch)
tree9dfef5030e3e7720282791e4585c396db095be02 /src/qml/jsruntime/qv4objectiterator.cpp
parent18376523d495597bbe009cf20d783816c9f3a44a (diff)
Implement support for ownKeys in Proxy objects
Change-Id: I7edee88e4252e6ed0d2666c3f633bb595cb0e831 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4objectiterator.cpp')
-rw-r--r--src/qml/jsruntime/qv4objectiterator.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4objectiterator.cpp b/src/qml/jsruntime/qv4objectiterator.cpp
index 89880d86dd..3d193455e9 100644
--- a/src/qml/jsruntime/qv4objectiterator.cpp
+++ b/src/qml/jsruntime/qv4objectiterator.cpp
@@ -54,7 +54,7 @@ void ForInIteratorPrototype::init(ExecutionEngine *)
PropertyKey ObjectIterator::next(Property *pd, PropertyAttributes *attrs)
{
- if (!object)
+ if (!object || !iterator)
return PropertyKey::invalid();
Scope scope(engine);
@@ -196,6 +196,10 @@ PropertyKey ForInIteratorObject::nextProperty() const
break;
delete d()->iterator;
d()->iterator = c->ownPropertyKeys();
+ if (!d()->iterator) {
+ scope.engine->throwTypeError();
+ return PropertyKey::invalid();
+ }
}
return PropertyKey::invalid();
}