aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlbinding.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2016-12-02 14:23:04 +0100
committerLars Knoll <lars.knoll@qt.io>2016-12-09 14:01:42 +0000
commit1eee98f1c1c59f8c45387684e269629713958bd4 (patch)
tree786e909d5427e07c08d9a7263d005723cf95c737 /src/qml/qml/qqmlbinding.cpp
parentf1dca03794f8db353655d44e742a2960f1f69070 (diff)
Limit access to m_function to QQmlJavaScriptExpression
Change-Id: I070f73f106440667fce2c7fe33310369a6aa1376 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlbinding.cpp')
-rw-r--r--src/qml/qml/qqmlbinding.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp
index f21d68b8a9..a8232904fe 100644
--- a/src/qml/qml/qqmlbinding.cpp
+++ b/src/qml/qml/qqmlbinding.cpp
@@ -85,7 +85,9 @@ QQmlBinding *QQmlBinding::create(const QQmlPropertyData *property, const QQmlScr
QV4::ExecutionEngine *v4 = QQmlEnginePrivate::get(b->context()->engine)->v4engine();
if (runtimeFunction) {
- b->m_function.set(v4, QV4::FunctionObject::createQmlFunction(ctxtdata, b->scopeObject(), runtimeFunction));
+ QV4::Scope scope(v4);
+ QV4::ScopedFunctionObject f(scope, QV4::FunctionObject::createQmlFunction(ctxtdata, b->scopeObject(), runtimeFunction));
+ b->setFunctionObject(f);
} else {
QString code = scriptPrivate->script;
b->createQmlBinding(b->context(), b->scopeObject(), code, url, scriptPrivate->lineNumber);
@@ -116,7 +118,7 @@ QQmlBinding *QQmlBinding::create(const QQmlPropertyData *property, const QV4::Fu
b->QQmlJavaScriptExpression::setContext(ctxt);
b->setScopeObject(obj);
- b->m_function.set(function->engine(), *function);
+ b->setFunctionObject(function);
return b;
}