diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-05-17 15:15:41 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-05-20 15:46:21 +0200 |
commit | 3a4e013f0058952c94ed3414aafbf96216efff8d (patch) | |
tree | aef9c33c9fda191b7c4ac1a4f56181a4a702990d /src/qml/jsruntime/qv4function.cpp | |
parent | 5bb746520db70b09de463f0ce27ecfbe3e5dfb4f (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/jsruntime/qv4function.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4function.cpp | 9 |
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) { |