diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-06-25 23:18:33 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-07-03 08:08:35 +0000 |
commit | 61440411a979c7c317bafccfbf5201d969819a06 (patch) | |
tree | 6c5825e21e75587121351bc612a76a7af81ef7be /src/qml/jsruntime/qv4qmlcontext.cpp | |
parent | 2aabdd187aae8a953cfcebac8f6c1ba7b19a0727 (diff) |
Prefix vtable methods with virtual
Turns out that the overloading of vtable methods and regular
ones is problematic in some cases. So let's rather make it explicit
which methods are part of the vtable, and which aren't.
Change-Id: Ifee32a26104d30f3c82bca8b5a9cdea2d4f4f526
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4qmlcontext.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4qmlcontext.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/qml/jsruntime/qv4qmlcontext.cpp b/src/qml/jsruntime/qv4qmlcontext.cpp index aa607c2d9a..dc69016559 100644 --- a/src/qml/jsruntime/qv4qmlcontext.cpp +++ b/src/qml/jsruntime/qv4qmlcontext.cpp @@ -78,25 +78,25 @@ void Heap::QQmlContextWrapper::destroy() Object::destroy(); } -ReturnedValue QQmlContextWrapper::get(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty) +ReturnedValue QQmlContextWrapper::virtualGet(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty) { Q_ASSERT(m->as<QQmlContextWrapper>()); if (!id.isString()) - return Object::get(m, id, receiver, hasProperty); + return Object::virtualGet(m, id, receiver, hasProperty); const QQmlContextWrapper *resource = static_cast<const QQmlContextWrapper *>(m); QV4::ExecutionEngine *v4 = resource->engine(); QV4::Scope scope(v4); if (resource->d()->isNullWrapper) - return Object::get(m, id, receiver, hasProperty); + return Object::virtualGet(m, id, receiver, hasProperty); if (v4->callingQmlContext() != *resource->d()->context) - return Object::get(m, id, receiver, hasProperty); + return Object::virtualGet(m, id, receiver, hasProperty); bool hasProp = false; - ScopedValue result(scope, Object::get(m, id, receiver, &hasProp)); + ScopedValue result(scope, Object::virtualGet(m, id, receiver, &hasProp)); if (hasProp) { if (hasProperty) *hasProperty = hasProp; @@ -229,12 +229,12 @@ ReturnedValue QQmlContextWrapper::get(const Managed *m, PropertyKey id, const Va return Encode::undefined(); } -bool QQmlContextWrapper::put(Managed *m, PropertyKey id, const Value &value, Value *receiver) +bool QQmlContextWrapper::virtualPut(Managed *m, PropertyKey id, const Value &value, Value *receiver) { Q_ASSERT(m->as<QQmlContextWrapper>()); if (id.isSymbol() || id.isArrayIndex()) - return Object::put(m, id, value, receiver); + return Object::virtualPut(m, id, value, receiver); QQmlContextWrapper *resource = static_cast<QQmlContextWrapper *>(m); ExecutionEngine *v4 = resource->engine(); @@ -256,7 +256,7 @@ bool QQmlContextWrapper::put(Managed *m, PropertyKey id, const Value &value, Val return false; } - return Object::put(m, id, value, receiver); + return Object::virtualPut(m, id, value, receiver); } // It's possible we could delay the calculation of the "actual" context (in the case @@ -301,7 +301,7 @@ bool QQmlContextWrapper::put(Managed *m, PropertyKey id, const Value &value, Val return false; } - return Object::put(m, id, value, receiver); + return Object::virtualPut(m, id, value, receiver); } void Heap::QmlContext::init(QV4::ExecutionContext *outerContext, QV4::QQmlContextWrapper *qml) |