aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmljavascriptexpression.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-05-17 15:15:41 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-05-20 15:46:21 +0200
commit3a4e013f0058952c94ed3414aafbf96216efff8d (patch)
treeaef9c33c9fda191b7c4ac1a4f56181a4a702990d /src/qml/qml/qqmljavascriptexpression.cpp
parent5bb746520db70b09de463f0ce27ecfbe3e5dfb4f (diff)
Do QMetaType-style call in QQmlPropertyBinding::evaluate
We already have a void* and metatype available. There is no need to convert, unless we have bound arguments. The call() itself will convert as necessary anyway. However, we do need to figure out whether the returned value was undefined. Pass this information up from the actual call. Change-Id: Icfa69e946adf80d18110a158f5bab906674b7381 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/qml/qml/qqmljavascriptexpression.cpp')
-rw-r--r--src/qml/qml/qqmljavascriptexpression.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp
index 95d7d89c99..95db27019c 100644
--- a/src/qml/qml/qqmljavascriptexpression.cpp
+++ b/src/qml/qml/qqmljavascriptexpression.cpp
@@ -303,10 +303,10 @@ bool QQmlJavaScriptExpression::evaluate(void **a, const QMetaType *types, int ar
Q_ASSERT(m_qmlScope.valueRef());
Q_ASSERT(function());
- function()->call(self, a, types, argc,
- static_cast<QV4::ExecutionContext *>(m_qmlScope.valueRef()));
+ const bool isUndefined = !function()->call(
+ self, a, types, argc, static_cast<QV4::ExecutionContext *>(m_qmlScope.valueRef()));
- return !capture.catchException(scope);
+ return !capture.catchException(scope) && !isUndefined;
}
void QQmlPropertyCapture::captureProperty(QQmlNotifier *n)