diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-05-03 21:50:18 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-04 18:12:50 +0000 |
commit | 4f086e3aacdab13625192b31adefe2d18ced2ae6 (patch) | |
tree | b466c2a4424f698b8b03285761ecedfe4f56be5e /src/qml/jsruntime/qv4runtime.cpp | |
parent | cff55a7a0da4e84527b6d04218da9b71c84e8f0e (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.cpp | 6 |
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(); } |