diff options
Diffstat (limited to 'src/qml/jsapi/qjsvalueiterator.cpp')
-rw-r--r-- | src/qml/jsapi/qjsvalueiterator.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/qml/jsapi/qjsvalueiterator.cpp b/src/qml/jsapi/qjsvalueiterator.cpp index 6dcfafaa27..449fb8235a 100644 --- a/src/qml/jsapi/qjsvalueiterator.cpp +++ b/src/qml/jsapi/qjsvalueiterator.cpp @@ -108,8 +108,10 @@ QJSValueIterator::QJSValueIterator(const QJSValue& object) return; QV4::Scope scope(v4); QV4::Scoped<QV4::ForEachIteratorObject> it(scope, d_ptr->iterator.value()); - it->it.flags = QV4::ObjectIterator::NoFlags; - it->it.next(d_ptr->nextName, &d_ptr->nextIndex, &d_ptr->nextProperty, &d_ptr->nextAttributes); + it->d()->it.flags = QV4::ObjectIterator::NoFlags; + QV4::String *nm = 0; + it->d()->it.next(nm, &d_ptr->nextIndex, &d_ptr->nextProperty, &d_ptr->nextAttributes); + d_ptr->nextName = nm; } /*! @@ -155,7 +157,9 @@ bool QJSValueIterator::next() return false; QV4::Scope scope(v4); QV4::Scoped<QV4::ForEachIteratorObject> it(scope, d_ptr->iterator.value()); - it->it.next(d_ptr->nextName, &d_ptr->nextIndex, &d_ptr->nextProperty, &d_ptr->nextAttributes); + QV4::String *nm = 0; + it->d()->it.next(nm, &d_ptr->nextIndex, &d_ptr->nextProperty, &d_ptr->nextAttributes); + d_ptr->nextName = nm; return !!d_ptr->currentName || d_ptr->currentIndex != UINT_MAX; } @@ -229,8 +233,10 @@ QJSValueIterator& QJSValueIterator::operator=(QJSValue& object) QV4::ScopedObject o(scope, jsp->value); d_ptr->iterator = v4->newForEachIteratorObject(v4->currentContext(), o)->asReturnedValue(); QV4::Scoped<QV4::ForEachIteratorObject> it(scope, d_ptr->iterator.value()); - it->it.flags = QV4::ObjectIterator::NoFlags; - it->it.next(d_ptr->nextName, &d_ptr->nextIndex, &d_ptr->nextProperty, &d_ptr->nextAttributes); + it->d()->it.flags = QV4::ObjectIterator::NoFlags; + QV4::String *nm = 0; + it->d()->it.next(nm, &d_ptr->nextIndex, &d_ptr->nextProperty, &d_ptr->nextAttributes); + d_ptr->nextName = nm; return *this; } |