aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qmlcompiler/qqmljsimportvisitor.cpp2
-rw-r--r--tests/auto/qml/qmllint/data/overridescript.qml7
-rw-r--r--tests/auto/qml/qmllint/data/testlogger.js1
-rw-r--r--tests/auto/qml/qmllint/tst_qmllint.cpp1
4 files changed, 10 insertions, 1 deletions
diff --git a/src/qmlcompiler/qqmljsimportvisitor.cpp b/src/qmlcompiler/qqmljsimportvisitor.cpp
index d5b5acd06b..5d858229dd 100644
--- a/src/qmlcompiler/qqmljsimportvisitor.cpp
+++ b/src/qmlcompiler/qqmljsimportvisitor.cpp
@@ -320,7 +320,7 @@ bool QQmlJSImportVisitor::visit(QQmlJS::AST::UiImport *import)
const auto scope = m_importer->importFile(path.canonicalFilePath());
m_rootScopeImports.insert(prefix.isEmpty() ? scope->internalName() : prefix, scope);
}
-
+ return true;
}
QString path {};
diff --git a/tests/auto/qml/qmllint/data/overridescript.qml b/tests/auto/qml/qmllint/data/overridescript.qml
new file mode 100644
index 0000000000..b85333b95f
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/overridescript.qml
@@ -0,0 +1,7 @@
+import QtQml
+import QtTest
+import "testlogger.js" as TestLogger
+
+QtObject {
+ objectName: TestLogger.log_start_test()
+}
diff --git a/tests/auto/qml/qmllint/data/testlogger.js b/tests/auto/qml/qmllint/data/testlogger.js
new file mode 100644
index 0000000000..c30bc3dd58
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/testlogger.js
@@ -0,0 +1 @@
+function log_start_test() { return true; }
diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp
index 994bb2cea0..895953c2f7 100644
--- a/tests/auto/qml/qmllint/tst_qmllint.cpp
+++ b/tests/auto/qml/qmllint/tst_qmllint.cpp
@@ -336,6 +336,7 @@ void TestQmllint::cleanQmlCode_data()
QTest::newRow("optionalImport") << QStringLiteral("optionalImport.qml");
QTest::newRow("goodAliasObject") << QStringLiteral("goodAliasObject.qml");
QTest::newRow("jsmoduleimport") << QStringLiteral("jsmoduleimport.qml");
+ QTest::newRow("overridescript") << QStringLiteral("overridescript.qml");
}
void TestQmllint::cleanQmlCode()