diff options
author | Lars Knoll <[email protected]> | 2018-09-08 22:29:47 +0200 |
---|---|---|
committer | Lars Knoll <[email protected]> | 2018-09-09 15:52:02 +0000 |
commit | 009a125d07448428a00abec70a894febe759adec (patch) | |
tree | c3c7411073517ce1931e4968f9928085d00782f6 /src/qml/jsruntime/qv4objectiterator.cpp | |
parent | 5d470f51214b273951cc7612ee018fc347716836 (diff) |
Fix ownKey iteration over Proxy objects
Change-Id: I045a4844c06df9232cc8b04485ab0a39bb990e3f
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4objectiterator.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4objectiterator.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4objectiterator.cpp b/src/qml/jsruntime/qv4objectiterator.cpp index 3eaf760792..906f6b38a6 100644 --- a/src/qml/jsruntime/qv4objectiterator.cpp +++ b/src/qml/jsruntime/qv4objectiterator.cpp @@ -164,6 +164,7 @@ PropertyKey ForInIteratorObject::nextProperty() const Scope scope(this); ScopedObject c(scope, d()->current); + ScopedObject t(scope, d()->target); ScopedObject o(scope); ScopedProperty p(scope); ScopedPropertyKey key(scope); @@ -171,7 +172,7 @@ PropertyKey ForInIteratorObject::nextProperty() const while (1) { while (1) { - key = d()->iterator->next(c, p, &attrs); + key = d()->iterator->next(t, p, &attrs); if (!key->isValid()) break; if (!attrs.isEnumerable() || key->isSymbol()) @@ -198,7 +199,8 @@ PropertyKey ForInIteratorObject::nextProperty() const if (!c) break; delete d()->iterator; - d()->iterator = c->ownPropertyKeys(); + d()->iterator = c->ownPropertyKeys(t.getRef()); + d()->target.set(scope.engine, t->d()); if (!d()->iterator) { scope.engine->throwTypeError(); return PropertyKey::invalid(); |