diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-09-23 11:35:54 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-09-27 08:34:06 +0000 |
commit | 9df44b2b502f9ab9a379c8454b000d2085aed744 (patch) | |
tree | 458f90b6c8d7bd1c45696cb4b56db30f30e504c4 /src/qml/jsruntime/qv4object.cpp | |
parent | b6f2b4308b024a92d18bdb81db9fa7dc37213eb3 (diff) |
Refactor deletion of properties
In line with the previous commit, allow entries with a valid
PropertyKey, but invalid attributes in the InternalClass. Those
entries mark a deleted property.
This cleans up/unifies some of the code in the internal class
implementation and allows re-using the slot if a deleted property
gets added again.
Change-Id: I1bada697486e3cafce7689bae87b7f884200dd99
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4object.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4object.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index b6446d39d1..ea374e43c0 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -364,18 +364,17 @@ PropertyKey ObjectOwnPropertyKeyIterator::next(const Object *o, Property *pd, Pr while (memberIndex < o->internalClass()->size) { PropertyKey n = o->internalClass()->nameMap.at(memberIndex); ++memberIndex; - if (!n.isStringOrSymbol()) { + if (!n.isStringOrSymbol()) // accessor properties have a dummy entry with n == 0 continue; - } - if (!iterateOverSymbols && n.isSymbol()) { + if (!iterateOverSymbols && n.isSymbol()) continue; - } - if (iterateOverSymbols && !n.isSymbol()) { + if (iterateOverSymbols && !n.isSymbol()) continue; - } InternalClassEntry e = o->internalClass()->find(n); + if (!e.isValid()) + continue; if (pd) { pd->value = *o->propertyData(e.index); if (e.attributes.isAccessor()) |