From 16d484c47f753caf02093ac5ce34e3c951f0a4a8 Mon Sep 17 00:00:00 2001 From: Dariusz Maciejewski Date: Tue, 18 Oct 2022 17:25:44 +0200 Subject: PATCH: TestCase.qml failed and hanged if the code being tested defines custom extensions of Array.prototype This fixes: https://bugreports.qt.io/browse/QTBUG-107759 See also: https://stackoverflow.com/questions/3010840/loop-through-an-array-in-javascript Change-Id: I96723f35398e9e4b9e9786df0fd02516c70191cd diff --git a/src/qmltest/TestCase.qml b/src/qmltest/TestCase.qml index 795833a467..720c7c6149 100644 --- a/src/qmltest/TestCase.qml +++ b/src/qmltest/TestCase.qml @@ -1926,7 +1926,7 @@ Item { testList.sort() } - for (var index in testList) { + for (var index = 0; index < testList.length; ++index) { var prop = testList[index] if (checkNames && !(prop in testsToRun))