diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-07-05 16:24:05 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-07-16 09:21:27 +0200 |
commit | 7e4b17943029b502cde63939a47f38ef900a9479 (patch) | |
tree | 6794242c6edbd07b7e5294ba43eaa6ea2752720e /src/qml/jsruntime/qv4arrayiterator.cpp | |
parent | 718bef9d2c85989479a8eef7e3a2837c42230c07 (diff) |
Implement array methods for QQmlListProperty
The test revealed that the fill() method of JS arrays did not properly
range-check its parameters. Fix that, too.
[ChangeLog][QtQml][Important Behavior Changes] QQmlListProperty behaves
like a JavaScript Array now. You can use map(), reduce(), forEach() etc
on it. This also includes a slight change of behavior to the push()
method. push() now returns the new list length, and it checks the length
to not exceed UINT_MAX.
Task-number: QTBUG-58831
Fixes: QTBUG-49613
Fixes: QTBUG-99041
Change-Id: Ia64d73fb704449c280fbbc7ddcf20f4698c82e09
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4arrayiterator.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4arrayiterator.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4arrayiterator.cpp b/src/qml/jsruntime/qv4arrayiterator.cpp index 80e7506143..15e0bf4e4c 100644 --- a/src/qml/jsruntime/qv4arrayiterator.cpp +++ b/src/qml/jsruntime/qv4arrayiterator.cpp @@ -36,7 +36,6 @@ ReturnedValue ArrayIteratorPrototype::method_next(const FunctionObject *b, const quint32 index = thisObject->d()->nextIndex; IteratorKind itemKind = thisObject->d()->iterationKind; - Scoped<TypedArray> ta(scope, a->as<TypedArray>()); quint32 len = a->getLength(); if (index >= len) { |