aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljsfunctioninitializer_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-06-15 14:16:11 +0200
committerUlf Hermann <ulf.hermann@qt.io>2022-07-07 19:33:39 +0200
commit38fdf2717d9c2432a9cd7de605f2e1c1517ff744 (patch)
treea24150dae1eb8715750048e0d605c88e16e1caab /src/qmlcompiler/qqmljsfunctioninitializer_p.h
parent3f3e961a5afe2e62f436f946c521ea4afab76dde (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/qmlcompiler/qqmljsfunctioninitializer_p.h')
-rw-r--r--src/qmlcompiler/qqmljsfunctioninitializer_p.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/qmlcompiler/qqmljsfunctioninitializer_p.h b/src/qmlcompiler/qqmljsfunctioninitializer_p.h
index 424690438d..9f191a4af8 100644
--- a/src/qmlcompiler/qqmljsfunctioninitializer_p.h
+++ b/src/qmlcompiler/qqmljsfunctioninitializer_p.h
@@ -23,21 +23,22 @@ class Q_QMLCOMPILER_PRIVATE_EXPORT QQmlJSFunctionInitializer
Q_DISABLE_COPY_MOVE(QQmlJSFunctionInitializer)
public:
QQmlJSFunctionInitializer(
- const QQmlJSTypeResolver *typeResolver, const QmlIR::Object *object,
- const QmlIR::Object *scope)
+ const QQmlJSTypeResolver *typeResolver,
+ const QV4::CompiledData::Location &objectLocation,
+ const QV4::CompiledData::Location &scopeLocation)
: m_typeResolver(typeResolver)
- , m_currentObject(object)
- , m_scopeType(typeResolver->scopeForLocation(scope->location))
- , m_objectType(typeResolver->scopeForLocation(object->location))
+ , m_scopeType(typeResolver->scopeForLocation(scopeLocation))
+ , m_objectType(typeResolver->scopeForLocation(objectLocation))
{}
QQmlJSCompilePass::Function run(
const QV4::Compiler::Context *context,
- const QString &propertyName, const QmlIR::Binding &irBinding,
+ const QString &propertyName, QQmlJS::AST::Node *astNode,
+ const QmlIR::Binding &irBinding,
QQmlJS::DiagnosticMessage *error);
QQmlJSCompilePass::Function run(
const QV4::Compiler::Context *context,
- const QString &functionName, const QmlIR::Function &irFunction,
+ const QString &functionName, QQmlJS::AST::Node *astNode,
QQmlJS::DiagnosticMessage *error);
private:
@@ -46,7 +47,6 @@ private:
QQmlJSCompilePass::Function *function, QQmlJS::DiagnosticMessage *error);
const QQmlJSTypeResolver *m_typeResolver = nullptr;
- const QmlIR::Object *m_currentObject = nullptr;
const QQmlJSScope::ConstPtr m_scopeType;
const QQmlJSScope::ConstPtr m_objectType;
};