diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-09-08 22:29:47 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-09-09 15:52:02 +0000 |
commit | 009a125d07448428a00abec70a894febe759adec (patch) | |
tree | c3c7411073517ce1931e4968f9928085d00782f6 /src/qml/jsruntime/qv4proxy.cpp | |
parent | 5d470f51214b273951cc7612ee018fc347716836 (diff) |
Fix ownKey iteration over Proxy objects
Change-Id: I045a4844c06df9232cc8b04485ab0a39bb990e3f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4proxy.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4proxy.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4proxy.cpp b/src/qml/jsruntime/qv4proxy.cpp index 895763d40e..a1138c2515 100644 --- a/src/qml/jsruntime/qv4proxy.cpp +++ b/src/qml/jsruntime/qv4proxy.cpp @@ -546,7 +546,7 @@ static bool removeAllOccurrences(ArrayObject *target, ReturnedValue val) { return found; } -OwnPropertyKeyIterator *ProxyObject::virtualOwnPropertyKeys(const Object *m) +OwnPropertyKeyIterator *ProxyObject::virtualOwnPropertyKeys(const Object *m, Value *iteratorTarget) { Scope scope(m); const ProxyObject *o = static_cast<const ProxyObject *>(m); @@ -564,7 +564,7 @@ OwnPropertyKeyIterator *ProxyObject::virtualOwnPropertyKeys(const Object *m) if (scope.hasException()) return nullptr; if (trap->isUndefined()) - return target->ownPropertyKeys(); + return target->ownPropertyKeys(iteratorTarget); if (!trap->isFunctionObject()) { scope.engine->throwTypeError(); return nullptr; @@ -637,12 +637,13 @@ OwnPropertyKeyIterator *ProxyObject::virtualOwnPropertyKeys(const Object *m) len = uncheckedResultKeys->getLength(); for (uint i = 0; i < len; ++i) { - if (targetConfigurableKeys->get(i) != Encode::undefined()) { + if (uncheckedResultKeys->get(i) != Encode::undefined()) { scope.engine->throwTypeError(); return nullptr; } } + *iteratorTarget = *m; return new ProxyObjectOwnPropertyKeyIterator(trapKeys); } |