diff options
author | Alberto Mardegan <alberto.mardegan@canonical.com> | 2014-01-28 14:03:44 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-28 14:52:31 +0100 |
commit | a1b6db4765d89b0081788e98dcdfdba5ed7fa121 (patch) | |
tree | 715f97e6c908ddbb4e8f891e29909bc2e75bd2a3 /tests | |
parent | 0825d24cf5c35a7c6fe37088f23b793e33c69063 (diff) |
V4: Array.push() on QStringList should invoke putIndexed()
Wrapped sequence types should cause putIndexed() method to be called
when Array.push() is used.
Fix suggested by Simon Hausmann.
[ChangeLog][QtQml] Fix JavaScript Array.push() not working on
QStringList properties.
Task-number: QTBUG-36491
Change-Id: Id04409dd7466a943d8ea8d57cd0514e8de732480
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/data/sequenceConversion.array.qml | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/sequenceConversion.array.qml b/tests/auto/qml/qqmlecmascript/data/sequenceConversion.array.qml index 8d08cc5559..8847055a70 100644 --- a/tests/auto/qml/qqmlecmascript/data/sequenceConversion.array.qml +++ b/tests/auto/qml/qqmlecmascript/data/sequenceConversion.array.qml @@ -141,6 +141,15 @@ Item { expected = 7; if (poppedVal != expected) success = false; + // push + msco.stringListProperty = [ "one", "two" ] + msco.stringListProperty.push("three") + expected = [ "one", "two", "three" ] + if (msco.stringListProperty.toString() != expected.toString()) success = false; + msco.stringListProperty.push("four", "five") + expected = [ "one", "two", "three", "four", "five" ] + if (msco.stringListProperty.toString() != expected.toString()) success = false; + // concat msco.stringListProperty = [ "one", "two" ] stringList = [ "hello", "world" ] |