aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4runtime.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-05-03 21:50:18 +0200
committerLars Knoll <lars.knoll@qt.io>2018-05-04 18:12:50 +0000
commit4f086e3aacdab13625192b31adefe2d18ced2ae6 (patch)
treeb466c2a4424f698b8b03285761ecedfe4f56be5e /src/qml/jsruntime/qv4runtime.cpp
parentcff55a7a0da4e84527b6d04218da9b71c84e8f0e (diff)
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 <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 3ddd543b40..1c1c3c3802 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -701,15 +701,15 @@ ReturnedValue Runtime::method_foreachIterator(ExecutionEngine *engine, const Val
ScopedObject o(scope, (Object *)nullptr);
if (!in.isNullOrUndefined())
o = in.toObject(engine);
- return engine->newForEachIteratorObject(o)->asReturnedValue();
+ return engine->newForInIteratorObject(o)->asReturnedValue();
}
ReturnedValue Runtime::method_foreachNextPropertyName(const Value &foreach_iterator)
{
Q_ASSERT(foreach_iterator.isObject());
- ForEachIteratorObject *it = static_cast<ForEachIteratorObject *>(foreach_iterator.objectValue());
- Q_ASSERT(it->as<ForEachIteratorObject>());
+ ForInIteratorObject *it = static_cast<ForInIteratorObject *>(foreach_iterator.objectValue());
+ Q_ASSERT(it->as<ForInIteratorObject>());
return it->nextPropertyName();
}