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/qml/qqmlvaluetypewrapper.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/qml/qqmlvaluetypewrapper.cpp')
-rw-r--r-- | src/qml/qml/qqmlvaluetypewrapper.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp index 341daf2391..50d7cbcc5e 100644 --- a/src/qml/qml/qqmlvaluetypewrapper.cpp +++ b/src/qml/qml/qqmlvaluetypewrapper.cpp @@ -209,7 +209,7 @@ PropertyAttributes QmlValueTypeWrapper::query(const Managed *m, StringRef name) const QmlValueTypeWrapper *r = m->as<const QmlValueTypeWrapper>(); QV4::ExecutionEngine *v4 = m->engine(); if (!r) { - v4->current->throwTypeError(); + v4->currentContext()->throwTypeError(); return PropertyAttributes(); } @@ -273,7 +273,7 @@ ReturnedValue QmlValueTypeWrapper::get(Managed *m, const StringRef name, bool *h QmlValueTypeWrapper *r = m->as<QmlValueTypeWrapper>(); QV4::ExecutionEngine *v4 = m->engine(); if (!r) - return v4->current->throwTypeError(); + return v4->currentContext()->throwTypeError(); // Note: readReferenceValue() can change the reference->type. if (r->objectType == QmlValueTypeWrapper::Reference) { @@ -306,7 +306,7 @@ ReturnedValue QmlValueTypeWrapper::get(Managed *m, const StringRef name, bool *h if (result->isFunction()) { // calling a Q_INVOKABLE function of a value type QQmlContextData *qmlContext = QV4::QmlContextWrapper::callingContext(v4); - return QV4::QObjectWrapper::getQmlProperty(v4->current, qmlContext, r->type, name.getPointer(), QV4::QObjectWrapper::IgnoreRevision); + return QV4::QObjectWrapper::getQmlProperty(v4->currentContext(), qmlContext, r->type, name.getPointer(), QV4::QObjectWrapper::IgnoreRevision); } #define VALUE_TYPE_LOAD(metatype, cpptype, constructor) \ @@ -339,7 +339,7 @@ void QmlValueTypeWrapper::put(Managed *m, const StringRef name, const ValueRef v Scoped<QmlValueTypeWrapper> r(scope, m->as<QmlValueTypeWrapper>()); if (!r) { - v4->current->throwTypeError(); + v4->currentContext()->throwTypeError(); return; } @@ -365,7 +365,7 @@ void QmlValueTypeWrapper::put(Managed *m, const StringRef name, const ValueRef v // assigning a JS function to a non-var-property is not allowed. QString error = QLatin1String("Cannot assign JavaScript function to value-type property"); Scoped<String> e(scope, r->v8->toString(error)); - v4->current->throwError(e); + v4->currentContext()->throwError(e); return; } |