diff options
Diffstat (limited to 'src/qml/jsruntime/qv4arraydata_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4arraydata_p.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4arraydata_p.h b/src/qml/jsruntime/qv4arraydata_p.h index 2b66369c4d..1de69a90e4 100644 --- a/src/qml/jsruntime/qv4arraydata_p.h +++ b/src/qml/jsruntime/qv4arraydata_p.h @@ -102,6 +102,7 @@ struct ArrayData : public Base { return vtable()->get(this, i); } inline Property *getProperty(uint index); + inline Value *getValueOrSetter(uint index, PropertyAttributes *attrs); inline PropertyAttributes attributes(uint i) const; bool isEmpty(uint i) const { @@ -284,6 +285,19 @@ inline PropertyAttributes ArrayData::attributes(uint i) const return static_cast<const SimpleArrayData *>(this)->attributes(i); } +Value *ArrayData::getValueOrSetter(uint index, PropertyAttributes *attrs) +{ + Property *p = getProperty(index); + if (!p) { + *attrs = Attr_Invalid; + return 0; + } + + *attrs = attributes(index); + return attrs->isAccessor() ? &p->set : &p->value; +} + + } |