diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2022-09-27 14:13:57 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-09-29 18:19:06 +0200 |
| commit | 4bc3f64b0edc5f097ca7cad4a89a535db67aa266 (patch) | |
| tree | 7aceecf29a4347167db3ce1572c7bf5e456f6272 /src/qml/jsruntime/qv4functionobject.cpp | |
| parent | 435d587e74ee7a726ccc29e137cd0032a16383b2 (diff) | |
| download | qtdeclarative-4bc3f64b0edc5f097ca7cad4a89a535db67aa266.tar.gz | |
V4: Use an enum to categorize functions and rename aotFunction
We want to use the aotFunction member also for typed JavaScript
functions.
Change-Id: Iad6d12ebed3ad3069832484137ed8e4d9e7a7cf4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 437f57e43f..a1d0c94b83 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -495,7 +495,7 @@ DEFINE_OBJECT_VTABLE(ArrowFunction); void ArrowFunction::virtualCallWithMetaTypes(const FunctionObject *fo, QObject *thisObject, void **a, const QMetaType *types, int argc) { - if (!fo->function()->aotFunction) { + if (fo->function()->kind != Function::AotCompiled) { QV4::convertAndCall(fo->engine(), thisObject, a, types, argc, [fo](const Value *thisObject, const Value *argv, int argc) { return ArrowFunction::virtualCall(fo, thisObject, argv, argc); @@ -514,9 +514,10 @@ void ArrowFunction::virtualCallWithMetaTypes(const FunctionObject *fo, QObject * ReturnedValue ArrowFunction::virtualCall(const FunctionObject *fo, const Value *thisObject, const Value *argv, int argc) { - if (const auto *aotFunction = fo->function()->aotFunction) { + Function *function = fo->function(); + if (function->kind == Function::AotCompiled) { return QV4::convertAndCall( - fo->engine(), aotFunction, thisObject, argv, argc, + fo->engine(), function->typedFunction, thisObject, argv, argc, [fo](QObject *thisObject, void **a, const QMetaType *types, int argc) { ArrowFunction::virtualCallWithMetaTypes(fo, thisObject, a, types, argc); }); |
