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.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)