diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-12-17 11:22:34 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-12-17 12:20:54 +0000 |
commit | 90307d688e8485c143ba291685aa847fb571f6fb (patch) | |
tree | 0db029c2e345114b4477332e5ea8ed5a9ad86369 /src | |
parent | c36eadc64a3db535246525b368634f08123655ef (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.
Fixes: QTBUG-86323
Change-Id: Id1924ac4087bab38c006b8eba92b619b79d36b7a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit dd740d6b3469448dc1fd31c1742781e923e9f274)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-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) { |