diff options
author | Alberto Mardegan <[email protected]> | 2014-01-28 14:03:44 +0200 |
---|---|---|
committer | The Qt Project <[email protected]> | 2014-01-28 14:52:31 +0100 |
commit | a1b6db4765d89b0081788e98dcdfdba5ed7fa121 (patch) | |
tree | 715f97e6c908ddbb4e8f891e29909bc2e75bd2a3 /src/qml/jsruntime/qv4arrayobject.cpp | |
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 <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4arrayobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4arrayobject.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp index 296471692c..d4829e587e 100644 --- a/src/qml/jsruntime/qv4arrayobject.cpp +++ b/src/qml/jsruntime/qv4arrayobject.cpp @@ -308,7 +308,7 @@ ReturnedValue ArrayPrototype::method_push(CallContext *ctx) return Encode(newLen); } - if (!instance->protoHasArray() && instance->arrayDataLen <= len) { + if (!instance->protoHasArray() && instance->arrayDataLen <= len && (instance->flags & SimpleArray)) { for (int i = 0; i < ctx->callData->argc; ++i) { if (!instance->sparseArray) { if (len >= instance->arrayAlloc) |