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/qv4managed.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/qv4managed.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4managed.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4managed.cpp b/src/qml/jsruntime/qv4managed.cpp index 3c44ed525b..647b858f0f 100644 --- a/src/qml/jsruntime/qv4managed.cpp +++ b/src/qml/jsruntime/qv4managed.cpp @@ -104,6 +104,9 @@ QString Managed::className() const case Type_V4Sequence: s = "V4Sequence"; break; + case Type_QmlListProperty: + s = "QML List"; + break; } return QString::fromLatin1(s); } |