aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4jsonobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4jsonobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4jsonobject.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp
index 458b46b36e..5aac8c8197 100644
--- a/src/qml/jsruntime/qv4jsonobject.cpp
+++ b/src/qml/jsruntime/qv4jsonobject.cpp
@@ -284,8 +284,13 @@ bool JsonParser::parseMember(ObjectRef o)
return false;
ScopedString s(scope, context->engine->newIdentifier(key));
- Property *p = o->insertMember(s, Attr_Data);
- p->value = val.asReturnedValue();
+ uint idx = s->asArrayIndex();
+ if (idx < UINT_MAX) {
+ o->putIndexed(idx, val);
+ } else {
+ Property *p = o->insertMember(s, Attr_Data);
+ p->value = val.asReturnedValue();
+ }
END;
return true;