aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmljavascriptexpression.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-10-24 14:57:53 +0200
committerLars Knoll <lars.knoll@qt.io>2017-11-13 08:56:11 +0000
commit831ddc54932d2681712ca9fa3e94484ae11d59f7 (patch)
tree0cf4ad8756d9cae65f3c57f1c77c946eaf1f5749 /src/qml/qml/qqmljavascriptexpression.cpp
parentd9b0878595e7ee2698ddc8c724657574d5fe4d4c (diff)
Cut out one more C++ layer when doing JS function calls
Change-Id: I0e2ac30b7e6d77fe41deb84a97b0a7f220437c6a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmljavascriptexpression.cpp')
-rw-r--r--src/qml/qml/qqmljavascriptexpression.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp
index 0208db2d48..006611e089 100644
--- a/src/qml/qml/qqmljavascriptexpression.cpp
+++ b/src/qml/qml/qqmljavascriptexpression.cpp
@@ -226,17 +226,11 @@ QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QV4::CallData *callData, b
}
Q_ASSERT(m_qmlScope.valueRef());
- callData->context = *m_qmlScope.valueRef();
- QV4::ReturnedValue res = v4Function->call(callData);
+ QV4::ReturnedValue res = v4Function->call(&callData->thisObject, callData->args, callData->argc(), static_cast<QV4::ExecutionContext *>(m_qmlScope.valueRef()));
QV4::Scope scope(v4);
QV4::ScopedValue result(scope, res);
if (v4Function->hasQmlDependencies) {
- QV4::Heap::ExecutionContext *c = static_cast<QV4::Heap::ExecutionContext *>(callData->context.m());
- // CreateCallContext might have been executed, and that will push a CallContext on top of
- // the current one. So, search back to the original QMLContext.
- while (c->type != QV4::Heap::ExecutionContext::Type_QmlContext)
- c = c->outer;
- QV4::Heap::QmlContext *qc = static_cast<QV4::Heap::QmlContext *>(c);
+ QV4::Heap::QmlContext *qc = m_qmlScope.as<QV4::QmlContext>()->d();
QQmlPropertyCapture::registerQmlDependencies(qc, v4, v4Function->compiledFunction);
}