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.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index a3cae3382d..38d46f3eea 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -1095,6 +1095,8 @@ void __qmljs_builtin_define_property(ExecutionContext *ctx, const ValueRef objec
uint idx = name->asArrayIndex();
if (idx != UINT_MAX) {
+ if (idx > 16 && (!o->arrayData || idx > o->arrayData->length() * 2))
+ o->initSparseArray();
o->arraySet(idx, val);
} else {
ScopedValue v(scope, val ? *val : Primitive::undefinedValue());