aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljsfunctioninitializer.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2024-05-31 14:02:34 +0200
committerUlf Hermann <ulf.hermann@qt.io>2024-06-15 07:04:12 +0200
commitf198d4e3f07f10d302af2535b7e3a943193947fd (patch)
treed5838d0be5c61af8e274e54026a8224b9648b24a /src/qmlcompiler/qqmljsfunctioninitializer.cpp
parent01d2f7f7def9b329db173ec4c4bbd4b909a59c9b (diff)
QmlCompiler: Divide scope-name lookup methods into multiple cases
* One method for IDs only, since that seems to be common * One method operating on QQmlJSRegisterContent all the way * One method operating on QQmlJSScope::ConstPtr all the way This way we can return a QQmlJSScope::ConstPtr where we are not interested in register contents, and in a next step, link the register contents together in case we are interested. We need to store the function's QML scope as QQmlJSRegisterContent now. Task-number: QTBUG-124670 Change-Id: I01699aaa5f645657d9faf23b12e270cf09679499 Reviewed-by: Alexei Cazacov <alexei.cazacov@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsfunctioninitializer.cpp')
-rw-r--r--src/qmlcompiler/qqmljsfunctioninitializer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qmlcompiler/qqmljsfunctioninitializer.cpp b/src/qmlcompiler/qqmljsfunctioninitializer.cpp
index 09928364b1..a767da68b6 100644
--- a/src/qmlcompiler/qqmljsfunctioninitializer.cpp
+++ b/src/qmlcompiler/qqmljsfunctioninitializer.cpp
@@ -160,7 +160,7 @@ QQmlJSCompilePass::Function QQmlJSFunctionInitializer::run(
bindingLocation.startColumn = irBinding.location.column();
QQmlJSCompilePass::Function function;
- function.qmlScope = m_scopeType;
+ function.qmlScope = m_typeResolver->globalType(m_scopeType);
if (irBinding.type() != QmlIR::Binding::Type_Script) {
diagnose(u"Binding is not a script binding, but %1."_s.arg(
@@ -270,7 +270,7 @@ QQmlJSCompilePass::Function QQmlJSFunctionInitializer::run(
Q_UNUSED(functionName);
QQmlJSCompilePass::Function function;
- function.qmlScope = m_scopeType;
+ function.qmlScope = m_typeResolver->globalType(m_scopeType);
auto ast = astNode->asFunctionDefinition();
Q_ASSERT(ast);