diff options
| author | Fabian Kosmale <fabian.kosmale@qt.io> | 2025-05-23 16:44:46 +0200 |
|---|---|---|
| committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2025-06-16 21:09:31 +0200 |
| commit | 781ea26485afbbd360e0f7669e799f8a3632cb65 (patch) | |
| tree | cf19ba3984675778aa23cf6ac0aa5ddec76f0906 /src/qmlcompiler/qqmljscompiler.cpp | |
| parent | f13b4a124e34922d84cbf7f687698e3f37ce0490 (diff) | |
QQmlJSImportVisitor: Add constructor without target
In many cases, we were passing a fresh scope to the QQmlJSImportVisitor
as the target.
Add a new constructor whih takes care of this, and use it wherever
possilbe. This allows disambiguating between call-sites that update an
existing scope, and those which will create a new one.
Change-Id: I140c349ac2f17371b7916d38225170420053a718
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljscompiler.cpp')
| -rw-r--r-- | src/qmlcompiler/qqmljscompiler.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/qmlcompiler/qqmljscompiler.cpp b/src/qmlcompiler/qqmljscompiler.cpp index c04ba26aa1..e910d93035 100644 --- a/src/qmlcompiler/qqmljscompiler.cpp +++ b/src/qmlcompiler/qqmljscompiler.cpp @@ -629,8 +629,7 @@ void QQmlJSAotCompiler::setDocument( m_logger->setFilePath(resourcePathInfo.fileName()); m_logger->setCode(irDocument->code); m_unitGenerator = &irDocument->jsGenerator; - QQmlJSScope::Ptr target = QQmlJSScope::create(); - QQmlJSImportVisitor visitor(target, m_importer, m_logger, + QQmlJSImportVisitor visitor(m_importer, m_logger, resourcePathInfo.canonicalPath() + u'/', m_qmldirFiles); m_typeResolver.init(&visitor, irDocument->program); |
