diff options
author | Lars Knoll <lars.knoll@qt.io> | 2016-12-02 14:23:04 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2016-12-09 14:01:42 +0000 |
commit | 1eee98f1c1c59f8c45387684e269629713958bd4 (patch) | |
tree | 786e909d5427e07c08d9a7263d005723cf95c737 /src/qml/qml/qqmlexpression.cpp | |
parent | f1dca03794f8db353655d44e742a2960f1f69070 (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/qqmlexpression.cpp')
-rw-r--r-- | src/qml/qml/qqmlexpression.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlexpression.cpp b/src/qml/qml/qqmlexpression.cpp index 6afbd05e3e..2a9d0a7b90 100644 --- a/src/qml/qml/qqmlexpression.cpp +++ b/src/qml/qml/qqmlexpression.cpp @@ -75,7 +75,9 @@ void QQmlExpressionPrivate::init(QQmlContextData *ctxt, QV4::Function *runtimeFu { expressionFunctionValid = true; QV4::ExecutionEngine *engine = QQmlEnginePrivate::getV4Engine(ctxt->engine); - m_function.set(engine, QV4::FunctionObject::createQmlFunction(ctxt, me, runtimeFunction)); + QV4::Scope scope(engine); + QV4::ScopedFunctionObject f(scope, QV4::FunctionObject::createQmlFunction(ctxt, me, runtimeFunction)); + setFunctionObject(f); QQmlJavaScriptExpression::setContext(ctxt); setScopeObject(me); |