diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-01-13 09:01:29 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2015-01-13 22:42:04 +0100 |
commit | 39f1e0d66dc434e764731fbfed29c8fd98d217aa (patch) | |
tree | d9855dbedd752c23395ccb6d4d3dc8fc3bece254 /src/qml/jsapi/qjsvalueiterator.cpp | |
parent | a38f9ec6c96559efa56e8f7346f74f5990810c3a (diff) |
Make sure we always have an engine when assigning to a Persistent
This prepares things for a rewrite of the internals of Persistent.
Change-Id: Ib93ec5911984d1bfce87ffdc3f86bc75f6ecafe9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsapi/qjsvalueiterator.cpp')
-rw-r--r-- | src/qml/jsapi/qjsvalueiterator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsapi/qjsvalueiterator.cpp b/src/qml/jsapi/qjsvalueiterator.cpp index 002a84ee08..c74a5d2d76 100644 --- a/src/qml/jsapi/qjsvalueiterator.cpp +++ b/src/qml/jsapi/qjsvalueiterator.cpp @@ -52,7 +52,7 @@ QJSValueIteratorPrivate::QJSValueIteratorPrivate(const QJSValue &v) QV4::Scope scope(e); QV4::ScopedObject o(scope, jsp->value); - iterator = e->newForEachIteratorObject(o)->asReturnedValue(); + iterator.set(e, e->newForEachIteratorObject(o)); currentName = (QV4::String *)0; nextName = (QV4::String *)0; @@ -216,14 +216,14 @@ QJSValueIterator& QJSValueIterator::operator=(QJSValue& object) d_ptr->nextName = (QV4::String *)0; QV4::ExecutionEngine *v4 = d_ptr->iterator.engine(); if (!v4) { - d_ptr->iterator = QV4::Encode::undefined(); + d_ptr->iterator.set(v4, QV4::Encode::undefined()); return *this; } QJSValuePrivate *jsp = QJSValuePrivate::get(object); QV4::Scope scope(v4); QV4::ScopedObject o(scope, jsp->value); - d_ptr->iterator = v4->newForEachIteratorObject(o)->asReturnedValue(); + d_ptr->iterator.set(v4, v4->newForEachIteratorObject(o)); QV4::Scoped<QV4::ForEachIteratorObject> it(scope, d_ptr->iterator.value()); it->d()->it.flags = QV4::ObjectIterator::NoFlags; QV4::ScopedString nm(scope); |