diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-09-23 12:10:12 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-09-27 08:33:55 +0000 |
commit | f63d48d474db7e9eff7583f1b8478228b13d3c82 (patch) | |
tree | 4bc1dd1f4f7b2f9a5df5b40247e1a8245169b903 /src/qml/jsruntime/qv4internalclass_p.h | |
parent | 1804fea8893c355dbd585e373cb9644387410a92 (diff) |
Differentiate between finding for get and set in InternalClass
This is required, so we can get rid of the requirement that
getter and setter live next to each other in the member data.
Change-Id: I2ed57a171628af4dfecd1836d00e958c6bed9d4f
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4internalclass_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4internalclass_p.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4internalclass_p.h b/src/qml/jsruntime/qv4internalclass_p.h index 82ace19d30..cced746568 100644 --- a/src/qml/jsruntime/qv4internalclass_p.h +++ b/src/qml/jsruntime/qv4internalclass_p.h @@ -369,7 +369,7 @@ struct InternalClass : Base { bool isValid() const { return index != UINT_MAX; } }; - IndexAndAttribute find(const PropertyKey id) + IndexAndAttribute findValueOrGetter(const PropertyKey id) { Q_ASSERT(id.isStringOrSymbol()); @@ -380,6 +380,19 @@ struct InternalClass : Base { return { UINT_MAX, Attr_Invalid }; } + IndexAndAttribute findValueOrSetter(const PropertyKey id) + { + Q_ASSERT(id.isStringOrSymbol()); + + PropertyHash::Entry *e = propertyTable.lookup(id); + if (e && e->index < size) { + PropertyAttributes a = propertyData.at(e->index); + return { a.isAccessor() ? e->index + 1 : e->index, a }; + } + + return { UINT_MAX, Attr_Invalid }; + } + uint indexOfValueOrGetter(const PropertyKey id) { Q_ASSERT(id.isStringOrSymbol()); |