diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-09-08 12:27:15 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-09-08 16:51:16 +0000 |
commit | 5d470f51214b273951cc7612ee018fc347716836 (patch) | |
tree | e6ae9e7f93b3dca3d307fe55de3c348223f816bc /src/qml/jsruntime/qv4property_p.h | |
parent | f726c56ce8ca5cfae510d8b81b44ad816f6ad245 (diff) |
Fix some bugs in Proxy::virtualGetOwnProperty
Change-Id: I28c32f2bfdac8848baf82905fb04790f29451805
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4property_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4property_p.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4property_p.h b/src/qml/jsruntime/qv4property_p.h index bad8eeb078..4e38bac470 100644 --- a/src/qml/jsruntime/qv4property_p.h +++ b/src/qml/jsruntime/qv4property_p.h @@ -78,6 +78,24 @@ struct Property { attrs->resolve(); } + // ES8: 6.2.5.6 + void completed(PropertyAttributes *attrs) { + if (value.isEmpty()) + value = Encode::undefined(); + if (attrs->isGeneric() || attrs->isData()) { + attrs->setType(PropertyAttributes::Data); + if (!attrs->hasWritable()) + attrs->setWritable(false); + } else { + if (set.isEmpty()) + set = Encode::undefined(); + } + if (!attrs->hasEnumerable()) + attrs->setEnumerable(false); + if (!attrs->hasConfigurable()) + attrs->setConfigurable(false); + } + inline bool isSubset(const PropertyAttributes &attrs, const Property *other, PropertyAttributes otherAttrs) const; inline void merge(PropertyAttributes &attrs, const Property *other, PropertyAttributes otherAttrs); |