diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-07-12 16:08:17 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-07-19 10:52:31 +0200 |
commit | ef057772c41e84e9813f0ed113fc55224013404c (patch) | |
tree | 80d1a7247825bcfccb577ce2ab6c0f248d435439 /tests/auto/qml/qqmlecmascript/data | |
parent | b335d8311f7c0be9261305d5b41bbcbf94cd3d27 (diff) |
Fix array-like methods on V4 sequences
We need to properly convert value type lists on assignment and we need
to add the "length" property to the own properties. Furthermore, the V4
sequence methods were confused about integer type ranges. We teach
them about qsizetype, properly range check everything, and drop the
artificial limitation to INT_MAX.
Pick-to: 6.4
Task-number: QTBUG-82443
Change-Id: Ie5af1130c9e78e412c171e6fa26a28a6a7a5d498
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/data')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/data/sequenceConversion.indexes.qml | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/sequenceConversion.indexes.qml b/tests/auto/qml/qqmlecmascript/data/sequenceConversion.indexes.qml index a3f306f717..b1d422b6e9 100644 --- a/tests/auto/qml/qqmlecmascript/data/sequenceConversion.indexes.qml +++ b/tests/auto/qml/qqmlecmascript/data/sequenceConversion.indexes.qml @@ -30,15 +30,19 @@ Item { var tooBigIndex = msco.tooBigIndex; var negativeIndex = msco.negativeIndex; - // shouldn't be able to set the length > maxIndex. - msco.intListProperty.length = tooBigIndex; + // We cannot test this anymore since INT_MAX + <a bit> is actually supported on 64bit. + // Trying to do this just wastes a lot of memory and takes forever. + // msco.intListProperty.length = tooBigIndex; + if (msco.intListProperty.length != expectedLength) success = false; if (!verifyExpected(msco.intListProperty, 4)) success = false; - // shouldn't be able to set any index > maxIndex. - msco.intListProperty[tooBigIndex] = 12; + // We cannot test this anymore since INT_MAX + <a bit> is actually supported on 64bit. + // Trying to do this just wastes a lot of memory and takes forever. + // msco.intListProperty[tooBigIndex] = 12; + if (msco.intListProperty.length != expectedLength) success = false; if (!verifyExpected(msco.intListProperty, 4)) |