diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-11-21 16:41:32 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-04 09:45:50 +0100 |
commit | 9306c05dd152511b8b938d7899a7bdf1aeb8d1c2 (patch) | |
tree | 514b6cda632244d7f9e7fdb1af143da05b7b1ce0 /src/qml/jsapi/qjsvalueiterator.cpp | |
parent | 0f32303e5cc9c539aa8698cab2b8cc2e946d885a (diff) |
Encapsulate the current context and fix it's usage
Encapsulate accesses to the current context, and rework
the way we push and pop this context from the context
stack.
Largely a cleanup, but simplifies the code in the long term
Change-Id: I409e378490d0ab027be6a4c01a4031b2ea35c51d
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 245b75b384..ed011ef691 100644 --- a/src/qml/jsapi/qjsvalueiterator.cpp +++ b/src/qml/jsapi/qjsvalueiterator.cpp @@ -59,7 +59,7 @@ QJSValueIteratorPrivate::QJSValueIteratorPrivate(const QJSValue &v) QV4::Scope scope(e); QV4::ScopedObject o(scope, jsp->value); - iterator = e->newForEachIteratorObject(e->current, o)->asReturnedValue(); + iterator = e->newForEachIteratorObject(e->currentContext(), o)->asReturnedValue(); currentName = (QV4::String *)0; nextName = (QV4::String *)0; @@ -198,7 +198,7 @@ QJSValue QJSValueIterator::value() const QV4::Scoped<QV4::ForEachIteratorObject> it(scope, d_ptr->iterator.value()); QV4::ScopedObject o(scope, it->it.object); - QV4::ExecutionContext *ctx = engine->current; + QV4::ExecutionContext *ctx = engine->currentContext(); QV4::ScopedValue v(scope); if (!!d_ptr->currentName) { QV4::ScopedString n(scope, d_ptr->currentName); @@ -237,7 +237,7 @@ QJSValueIterator& QJSValueIterator::operator=(QJSValue& object) QJSValuePrivate *jsp = QJSValuePrivate::get(object); QV4::Scope scope(v4); QV4::ScopedObject o(scope, jsp->value); - d_ptr->iterator = v4->newForEachIteratorObject(v4->current, o)->asReturnedValue(); + 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->nextAttributes); |