diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-06-23 23:07:23 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-07-02 19:29:43 +0000 |
commit | 56bff8f7abc2f0eeadd4d197667132af6eed6f3a (patch) | |
tree | 13990d34f9239e1845dedaa452bc1093f38b027a /src/qml/qml | |
parent | 86f88521fbea59e8ec53e50cc1e3e68a61f53c40 (diff) |
Clean up the property key API in StringOrSymbol
Get rid of makeIdentifier(), as toPropertyKey() will take
care of it.
Rename identifier() to propertyKey() and check that the
key is valid.
Remove String/StringOrSymbol::asArrayIndex(), we don't need it
anymore.
Change-Id: I3c490fabc1475c9ea288b49b1638b6fa1bc237b7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/qqmllistwrapper.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlxmlhttprequest.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/qml/qqmllistwrapper.cpp b/src/qml/qml/qqmllistwrapper.cpp index a6e0f5cc33..82eb08ddc9 100644 --- a/src/qml/qml/qqmllistwrapper.cpp +++ b/src/qml/qml/qqmllistwrapper.cpp @@ -121,7 +121,7 @@ ReturnedValue QmlListWrapper::get(const Managed *m, PropertyKey id, const Value *hasProperty = false; return Primitive::undefinedValue().asReturnedValue(); } else if (id.isString()) { - if (id == v4->id_length()->identifier() && !w->d()->object.isNull()) { + if (id == v4->id_length()->propertyKey() && !w->d()->object.isNull()) { quint32 count = w->d()->property().count ? w->d()->property().count(&w->d()->property()) : 0; return Primitive::fromUInt32(count).asReturnedValue(); } diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index 2e5ce29f21..c6f85069c3 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -909,7 +909,7 @@ ReturnedValue NamedNodeMap::get(const Managed *m, PropertyKey id, const Value *r if (id.isSymbol()) return Object::get(m, id, receiver, hasProperty); - if (id == v4->id_length()->identifier()) + if (id == v4->id_length()->propertyKey()) return Primitive::fromInt32(r->d()->list().count()).asReturnedValue(); QString str = id.toQString(); @@ -949,7 +949,7 @@ ReturnedValue NodeList::get(const Managed *m, PropertyKey id, const Value *recei return Encode::undefined(); } - if (id == v4->id_length()->identifier()) + if (id == v4->id_length()->propertyKey()) return Primitive::fromInt32(r->d()->d->children.count()).asReturnedValue(); return Object::get(m, id, receiver, hasProperty); } |