diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2023-06-12 16:33:28 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2023-06-14 10:35:22 +0200 |
commit | f9d74e8326b11b39b3bdbcb1ff87a9c8f8bc0d34 (patch) | |
tree | d8cd031ac18835cc7d836f9f463cd7dce181b738 /tests/auto/qml/qmllint | |
parent | 15082891f78d3e6df121fbaef7626be5250bd1e4 (diff) |
QQmlJSTypePropagator: Support StoreNameStrict
As far as the type propagator is concerned, it is the the same as
StoreNameSloppy. This allows the unqualified id check to work in strict
functions, too.
Pick-to: 6.5 6.6
Change-Id: Ie4ca823c996e058e4cdde632acaa1caa146b77bc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qmllint')
-rw-r--r-- | tests/auto/qml/qmllint/data/UnqualifiedInStoreStrict.qml | 12 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/tst_qmllint.cpp | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/UnqualifiedInStoreStrict.qml b/tests/auto/qml/qmllint/data/UnqualifiedInStoreStrict.qml new file mode 100644 index 0000000000..198e2146f5 --- /dev/null +++ b/tests/auto/qml/qmllint/data/UnqualifiedInStoreStrict.qml @@ -0,0 +1,12 @@ +import QtQuick 2.15 +import QtQuick.Window 2.15 + +Window { + Rectangle { + property real divisor: 0 + + Timer { + onTriggered: function() {"use strict"; divisor = 1 } + } + } +} diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp index a74e504473..1f882ad885 100644 --- a/tests/auto/qml/qmllint/tst_qmllint.cpp +++ b/tests/auto/qml/qmllint/tst_qmllint.cpp @@ -263,6 +263,9 @@ void TestQmllint::testUnqualified_data() QTest::newRow("storeSloppy") << QStringLiteral("UnqualifiedInStoreSloppy.qml") << Result{ { Message{ QStringLiteral("Unqualified access"), 9, 26} } }; + QTest::newRow("storeStrict") + << QStringLiteral("UnqualifiedInStoreStrict.qml") + << Result{ { Message{ QStringLiteral("Unqualified access"), 9, 52} } }; } void TestQmllint::testUnknownCausesFail() |