diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-12-17 11:22:34 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-12-17 11:33:52 +0100 |
commit | dd740d6b3469448dc1fd31c1742781e923e9f274 (patch) | |
tree | c01e7bd5f4c11a213d5b50e2b9cf0a7134addd76 /src/qml/jsruntime/qv4proxy.cpp | |
parent | 86a595b126bc6794380dc00af80ec4802f7d058c (diff) |
QML: Fix proxy iteration
If the target of a proxy was extensible, we did not set the
iteratorTarget to its correct value, and thus the ForInIteratorObject
would not be usable.
Pick-to: 6.0 5.15
Fixes: QTBUG-86323
Change-Id: Id1924ac4087bab38c006b8eba92b619b79d36b7a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4proxy.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4proxy.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4proxy.cpp b/src/qml/jsruntime/qv4proxy.cpp index 1505eae426..8bfc9fc3ba 100644 --- a/src/qml/jsruntime/qv4proxy.cpp +++ b/src/qml/jsruntime/qv4proxy.cpp @@ -624,8 +624,10 @@ OwnPropertyKeyIterator *ProxyObject::virtualOwnPropertyKeys(const Object *m, Val else targetNonConfigurableKeys->push_back(keyAsValue); } - if (target->isExtensible() && targetNonConfigurableKeys->getLength() == 0) + if (target->isExtensible() && targetNonConfigurableKeys->getLength() == 0) { + *iteratorTarget = *m; return new ProxyObjectOwnPropertyKeyIterator(trapKeys); + } ScopedArrayObject uncheckedResultKeys(scope, scope.engine->newArrayObject()); uncheckedResultKeys->copyArrayData(trapKeys); @@ -639,8 +641,10 @@ OwnPropertyKeyIterator *ProxyObject::virtualOwnPropertyKeys(const Object *m, Val } } - if (target->isExtensible()) + if (target->isExtensible()) { + *iteratorTarget = *m; return new ProxyObjectOwnPropertyKeyIterator(trapKeys); + } len = targetConfigurableKeys->getLength(); for (uint i = 0; i < len; ++i) { |