diff options
Diffstat (limited to 'src/qml/jsruntime/qv4object.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4object.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index e58b9d8168..4c36d24c1a 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -553,6 +553,18 @@ bool Object::internalPut(PropertyKey id, const Value &value, Value *receiver) attrs = Attr_Data; } + if (r->internalClass()->vtable->defineOwnProperty == virtualDefineOwnProperty) { + // standard object, we can avoid some more checks + uint index = id.asArrayIndex(); + if (index == UINT_MAX) { + ScopedStringOrSymbol s(scope, id.asStringOrSymbol()); + r->insertMember(s, value); + } else { + r->arraySet(index, value); + } + return true; + } + p->value = value; return r->defineOwnProperty(id, p, attrs); } |
