diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-06-15 14:16:11 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-07-07 19:33:39 +0200 |
commit | 38fdf2717d9c2432a9cd7de605f2e1c1517ff744 (patch) | |
tree | a24150dae1eb8715750048e0d605c88e16e1caab /src/qml/compiler/qqmlirbuilder.cpp | |
parent | 3f3e961a5afe2e62f436f946c521ea4afab76dde (diff) |
QmlCompiler: Handle trivial signal handler constructions
If the signal handler does nothing but return a closure, we have to
compile the closure using the same signature as the outer signal
handler.
In order for this to work, we also have to detect unresolved argument
types for signal handlers. Those are just as bad as unresolved argument
types for other functions.
Fixes: QTBUG-101531
Change-Id: Idb5b3994809d91a4b4ce936282685435eb75e670
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/compiler/qqmlirbuilder.cpp')
-rw-r--r-- | src/qml/compiler/qqmlirbuilder.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp index 213c73d031..0d317971d0 100644 --- a/src/qml/compiler/qqmlirbuilder.cpp +++ b/src/qml/compiler/qqmlirbuilder.cpp @@ -1807,8 +1807,10 @@ char *QmlUnitGenerator::writeBindings(char *bindingPtr, const Object *o, Binding } JSCodeGen::JSCodeGen(Document *document, const QSet<QString> &globalNames, - QV4::Compiler::CodegenWarningInterface *interface) - : QV4::Compiler::Codegen(&document->jsGenerator, /*strict mode*/ false, interface), + QV4::Compiler::CodegenWarningInterface *interface, + bool storeSourceLocations) + : QV4::Compiler::Codegen(&document->jsGenerator, /*strict mode*/ false, interface, + storeSourceLocations), document(document) { m_globalNames = globalNames; @@ -1817,7 +1819,7 @@ JSCodeGen::JSCodeGen(Document *document, const QSet<QString> &globalNames, } QVector<int> JSCodeGen::generateJSCodeForFunctionsAndBindings( - const QList<CompiledFunctionOrExpression> &functions, bool storeSourceLocation) + const QList<CompiledFunctionOrExpression> &functions) { auto qmlName = [&](const CompiledFunctionOrExpression &c) { if (c.nameIndex != 0) @@ -1888,7 +1890,7 @@ QVector<int> JSCodeGen::generateJSCodeForFunctionsAndBindings( } int idx = defineFunction(name, function ? function : qmlFunction.parentNode, - function ? function->formals : nullptr, body, storeSourceLocation); + function ? function->formals : nullptr, body); runtimeFunctionIndices[i] = idx; } |