aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4runtime.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index a8b453309d..2f1b8a0bd3 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -613,7 +613,7 @@ void __qmljs_set_element(ExecutionContext *ctx, const ValueRef object, const Val
uint idx = index->asArrayIndex();
if (idx < UINT_MAX) {
- if (idx < o->arrayData->length() && o->arrayType() == ArrayData::Simple)
+ if (o->arrayType() == ArrayData::Simple && idx < o->arrayData->length())
o->arrayData->put(idx, value);
else
o->putIndexed(idx, value);
@@ -1105,7 +1105,6 @@ ReturnedValue __qmljs_builtin_define_array(ExecutionContext *ctx, SafeValue *val
if (length) {
a->arrayReserve(length);
- a->arrayData->setLength(length);
a->arrayData->put(0, values, length);
a->setArrayLengthUnchecked(length);
}