aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmljavascriptexpression.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2016-12-02 15:19:45 +0100
committerLars Knoll <lars.knoll@qt.io>2016-12-09 14:01:49 +0000
commitc953f8b550b7ea9e7989f9fddaaa14324354aea3 (patch)
tree02ec1179f225e7b8080136e9e9afc8d6da7fcc32 /src/qml/qml/qqmljavascriptexpression.cpp
parent421d21a0334002f6497ce105876856dc0647c8ff (diff)
Avoid the creation of a FunctionObject for most bindings
Change-Id: Ia62d380945250015009d9c2b6ed65f6d830277ef Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
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 dc7c1cb8e1..5c6c0a0dce 100644
--- a/src/qml/qml/qqmljavascriptexpression.cpp
+++ b/src/qml/qml/qqmljavascriptexpression.cpp
@@ -467,6 +467,15 @@ void QQmlJavaScriptExpression::setFunctionObject(const QV4::FunctionObject *o)
m_compilationUnit = m_v4Function->compilationUnit;
}
+void QQmlJavaScriptExpression::setupFunction(QV4::QmlContext *qmlContext, QV4::Function *f)
+{
+ if (!qmlContext || !f)
+ return;
+ m_qmlScope.set(qmlContext->engine(), *qmlContext);
+ m_v4Function = f;
+ m_compilationUnit = m_v4Function->compilationUnit;
+}
+
void QQmlJavaScriptExpression::clearActiveGuards()
{
while (QQmlJavaScriptExpressionGuard *g = activeGuards.takeFirst())