aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmljavascriptexpression.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2016-12-05 10:50:55 +0100
committerLars Knoll <lars.knoll@qt.io>2016-12-09 14:01:53 +0000
commitbf661342652b02177fc1a5cd29195a443dac5bc1 (patch)
tree6ef88c7f91ab3b7f0c39480daec21db9eaed0ce2 /src/qml/qml/qqmljavascriptexpression.cpp
parentc953f8b550b7ea9e7989f9fddaaa14324354aea3 (diff)
Don't create a FunctionObject in createQmlBinding()
This also removes the last use of the QmlBindingWrapper, so remove that class as well. Change-Id: I2ec795b6ab695a689fb24d64c9b8809b651c2b37 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmljavascriptexpression.cpp')
-rw-r--r--src/qml/qml/qqmljavascriptexpression.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp
index 5c6c0a0dce..96a9f5b6b1 100644
--- a/src/qml/qml/qqmljavascriptexpression.cpp
+++ b/src/qml/qml/qqmljavascriptexpression.cpp
@@ -431,10 +431,7 @@ void QQmlJavaScriptExpression::createQmlBinding(QQmlContextData *ctxt, QObject *
QV4::Scoped<QV4::QmlContext> qmlContext(scope, QV4::QmlContext::create(v4->rootContext(), ctxt, qmlScope));
QV4::Script script(v4, qmlContext, code, filename, line);
- QV4::ScopedFunctionObject result(scope);
script.parse();
- if (!v4->hasException)
- result = script.qmlBinding();
if (v4->hasException) {
QQmlError error = v4->catchExceptionAsQmlError();
if (error.description().isEmpty())
@@ -445,9 +442,9 @@ void QQmlJavaScriptExpression::createQmlBinding(QQmlContextData *ctxt, QObject *
error.setUrl(QUrl::fromLocalFile(filename));
error.setObject(qmlScope);
ep->warning(error);
- result = QV4::Encode::undefined();
+ return;
}
- setFunctionObject(result);
+ setupFunction(qmlContext, script.vmFunction);
}
void QQmlJavaScriptExpression::setFunctionObject(const QV4::FunctionObject *o)