diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-04-06 20:01:17 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-02 14:18:15 +0000 |
commit | 1941e4587bf6b38e2a8a1875329ed75b829b617f (patch) | |
tree | 92a7bc19a64d8e41cfc677161dda1d72eb212b1a /src/qml/jsruntime/qv4object.cpp | |
parent | e4a2b2885d1847624dcbc6b9e4dfdedf04767fe3 (diff) |
Unify MemberData::Index and ArrayData::Index
Both classes basically did the same thing. Unify them in a new
PropertyIndex class.
Change-Id: Ieb6fb670e4d204bf20ee4c0b70b4381c95c6268e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4object.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4object.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index 56f93ef1ce..3d5d116258 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -304,7 +304,7 @@ void Object::getOwnProperty(uint index, PropertyAttributes *attrs, Property *p) } // Section 8.12.2 -MemberData::Index Object::getValueOrSetter(String *name, PropertyAttributes *attrs) +PropertyIndex Object::getValueOrSetter(String *name, PropertyAttributes *attrs) { Q_ASSERT(name->asArrayIndex() == UINT_MAX); @@ -325,7 +325,7 @@ MemberData::Index Object::getValueOrSetter(String *name, PropertyAttributes *att return { nullptr, nullptr }; } -ArrayData::Index Object::getValueOrSetter(uint index, PropertyAttributes *attrs) +PropertyIndex Object::getValueOrSetter(uint index, PropertyAttributes *attrs) { Heap::Object *o = d(); while (o) { @@ -333,7 +333,7 @@ ArrayData::Index Object::getValueOrSetter(uint index, PropertyAttributes *attrs) uint idx = o->arrayData->mappedIndex(index); if (idx != UINT_MAX) { *attrs = o->arrayData->attributes(index); - return { o->arrayData , attrs->isAccessor() ? idx + SetterOffset : idx }; + return { o->arrayData , o->arrayData->values.values + (attrs->isAccessor() ? idx + SetterOffset : idx) }; } } if (o->vtable()->type == Type_StringObject) { @@ -629,7 +629,7 @@ bool Object::internalPut(String *name, const Value &value) name->makeIdentifier(); Identifier id = name->identifier(); - MemberData::Index memberIndex{nullptr, nullptr}; + PropertyIndex memberIndex{nullptr, nullptr}; uint member = internalClass()->find(id); PropertyAttributes attrs; if (member < UINT_MAX) { @@ -705,7 +705,7 @@ bool Object::internalPutIndexed(uint index, const Value &value) PropertyAttributes attrs; - ArrayData::Index arrayIndex = arrayData() ? arrayData()->getValueOrSetter(index, &attrs) : ArrayData::Index{ nullptr, 0 }; + PropertyIndex arrayIndex = arrayData() ? arrayData()->getValueOrSetter(index, &attrs) : PropertyIndex{ nullptr, 0 }; if (arrayIndex.isNull() && isStringObject()) { if (index < static_cast<StringObject *>(this)->length()) |