From 4f086e3aacdab13625192b31adefe2d18ced2ae6 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 3 May 2018 21:50:18 +0200 Subject: Rename ForeachIterator to ForInIterator As it's being used for for(... in ...) loops. Also add a ES6 compatible iterator interface to it, so that we can unify the handling of for-in and for-of. Change-Id: I264f88ed049484945f5ea7e8bdf0227187456ba2 Reviewed-by: Simon Hausmann --- src/qml/jsapi/qjsvalueiterator.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/qml/jsapi') diff --git a/src/qml/jsapi/qjsvalueiterator.cpp b/src/qml/jsapi/qjsvalueiterator.cpp index ce472ce7e5..222f63ed4a 100644 --- a/src/qml/jsapi/qjsvalueiterator.cpp +++ b/src/qml/jsapi/qjsvalueiterator.cpp @@ -57,7 +57,7 @@ QJSValueIteratorPrivate::QJSValueIteratorPrivate(const QJSValue &v) QV4::Scope scope(e); QV4::ScopedObject o(scope, QJSValuePrivate::getValue(&v)); - iterator.set(e, e->newForEachIteratorObject(o)); + iterator.set(e, e->newForInIteratorObject(o)); } @@ -102,7 +102,7 @@ QJSValueIterator::QJSValueIterator(const QJSValue& object) if (!v4) return; QV4::Scope scope(v4); - QV4::Scoped it(scope, d_ptr->iterator.value()); + QV4::Scoped it(scope, d_ptr->iterator.value()); it->d()->it().flags = QV4::ObjectIterator::NoFlags; QV4::ScopedString nm(scope); QV4::Property nextProperty; @@ -153,7 +153,7 @@ bool QJSValueIterator::next() if (!v4) return false; QV4::Scope scope(v4); - QV4::Scoped it(scope, d_ptr->iterator.value()); + QV4::Scoped it(scope, d_ptr->iterator.value()); QV4::ScopedString nm(scope); QV4::Property nextProperty; QV4::PropertyAttributes nextAttributes; @@ -229,8 +229,8 @@ QJSValueIterator& QJSValueIterator::operator=(QJSValue& object) QV4::Scope scope(v4); QV4::ScopedObject o(scope, QJSValuePrivate::getValue(&object)); - d_ptr->iterator.set(v4, v4->newForEachIteratorObject(o)); - QV4::Scoped it(scope, d_ptr->iterator.value()); + d_ptr->iterator.set(v4, v4->newForInIteratorObject(o)); + QV4::Scoped it(scope, d_ptr->iterator.value()); it->d()->it().flags = QV4::ObjectIterator::NoFlags; QV4::ScopedString nm(scope); QV4::Property nextProperty; -- cgit v1.2.3