aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmljavascriptexpression.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/qqmljavascriptexpression.cpp')
-rw-r--r--src/qml/qml/qqmljavascriptexpression.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp
index e40795283a..61879e8b2d 100644
--- a/src/qml/qml/qqmljavascriptexpression.cpp
+++ b/src/qml/qml/qqmljavascriptexpression.cpp
@@ -231,6 +231,15 @@ QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QV4::CallData *callData, b
Q_ASSERT(m_qmlScope.valueRef());
callData->context = *m_qmlScope.valueRef();
result = v4Function->call(callData);
+ 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);
+ QQmlPropertyCapture::registerQmlDependencies(qc, v4, v4Function->compiledFunction);
+ }
if (scope.hasException()) {
if (watcher.wasDeleted())