summaryrefslogtreecommitdiff
path: root/src/qml/jsruntime/qv4function.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-06-02 21:04:35 +0200
commit278e8df17b073f96d8ff89d7a470fe63802ed15e (patch)
tree913403a98be4e09d101d48af6861ada2a3d1abc5 /src/qml/jsruntime/qv4function.cpp
parentc6c31740a7377715ce53fea5f323c4e48525e425 (diff)
downloadqtdeclarative-278e8df17b073f96d8ff89d7a470fe63802ed15e.tar.gz
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. This reverts commit 8ac705247430ff6fbbc25a9db20c0e7dc572abe7. The original commit 3a4e013f0058952c94ed3414aafbf96216efff8d was correct. We were just missing the value type conversions in metaTypeFromJS(). Change-Id: Ic4b2ebf1eb3fb2e5a50a045be774dd02d0fed7c6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4function.cpp')
-rw-r--r--src/qml/jsruntime/qv4function.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp
index 348837c3a5..f6001da1f8 100644
--- a/src/qml/jsruntime/qv4function.cpp
+++ b/src/qml/jsruntime/qv4function.cpp
@@ -57,15 +57,15 @@ QT_BEGIN_NAMESPACE
using namespace QV4;
-void Function::call(const Value *thisObject, void **a, const QMetaType *types, int argc,
+bool Function::call(const Value *thisObject, void **a, const QMetaType *types, int argc,
const ExecutionContext *context)
{
if (!aotFunction) {
- QV4::convertAndCall(context->engine(), thisObject, a, types, argc,
- [this, context](const Value *thisObject, const Value *argv, int argc) {
+ return QV4::convertAndCall(
+ context->engine(), thisObject, a, types, argc,
+ [this, context](const Value *thisObject, const Value *argv, int argc) {
return call(thisObject, argv, argc, context);
});
- return;
}
ExecutionEngine *engine = context->engine();
@@ -77,6 +77,7 @@ void Function::call(const Value *thisObject, void **a, const QMetaType *types, i
engine->jsStackTop += frame.requiredJSStackFrameSize();
Moth::VME::exec(&frame, engine);
frame.pop(engine);
+ return true;
}
ReturnedValue Function::call(const Value *thisObject, const Value *argv, int argc, const ExecutionContext *context) {