aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4arraydata_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-08-26 09:15:09 +0200
committerLars Knoll <lars.knoll@theqtcompany.com>2015-09-15 19:13:16 +0000
commit15cd948bdaed4f2e64fa879106e7237d958695b0 (patch)
tree81d3350205af780ce97739c2f498d59c0a824574 /src/qml/jsruntime/qv4arraydata_p.h
parent7d52d7e529ff83426ffd57330cab70b9d77c39df (diff)
Replace __getPropertyDescriptor__ with a getValueOrSetter call
This one returns a pointer to a Value instead of a property. Change-Id: I66e16526cc61d1ff3564cae983881c30b9106b54 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4arraydata_p.h')
-rw-r--r--src/qml/jsruntime/qv4arraydata_p.h14
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;
+}
+
+
}