aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2024-07-02 10:43:06 +0200
committerUlf Hermann <ulf.hermann@qt.io>2024-07-02 21:16:21 +0200
commitae76c8f428e9ca7ac5d398b51ffdb03407a26f04 (patch)
treee2facc49ce31ddac41b096d6fc789258d1ca9367 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
parentcbc694491b8431fd3dcf82c3d17a17a06cbccebc (diff)
QmlCompiler: Fix side effect detection for array methods
Array methods that manipulate the array they are called on always have side effects, on that array. In order to optimize them out we'd have to do some more involved tracking of affected values. Amends commit e84686415187455a7153d61ca82478053f13e3f9 Fixes: QTBUG-126834 Pick-to: 6.8 6.7 Change-Id: Ia4395ea21e89590e6ffe95e236f70b5e64402f5e Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index 21d649a690..22479d3d9c 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -2752,6 +2752,8 @@ void tst_QmlCppCodegen::jsArrayMethods()
QCOMPARE(object->property("listPropertyLastIndexOf"), object->property("jsArrayLastIndexOf"));
QCOMPARE(object->property("listPropertyLastIndexOf").toInt(), 5);
+
+ QCOMPARE(check->property("pushAndJoin").toString(), QStringLiteral("A+B"));
}
void tst_QmlCppCodegen::jsArrayMethodsWithParams()