diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-04-07 13:28:59 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-02 14:18:27 +0000 |
commit | d1af494793961a31747b689cf307b65d99367486 (patch) | |
tree | 1e89898065334e841ded62499331274cb9d0b230 /src/qml/qml/qqmlxmlhttprequest.cpp | |
parent | 3c090c80c58d99f1bd29493ef747a4f6fa915a71 (diff) |
Change Objects vtable methods to take a StringOrSymbol
This is needed for symbol support.
Change-Id: I83db21f232168710d18999fd97d912016e86d630
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlxmlhttprequest.cpp')
-rw-r--r-- | src/qml/qml/qqmlxmlhttprequest.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index 9d3388c2f2..41531c1df3 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -228,7 +228,7 @@ public: static ReturnedValue create(ExecutionEngine *, NodeImpl *, const QList<NodeImpl *> &); // JS API - static ReturnedValue get(const Managed *m, String *name, bool *hasProperty); + static ReturnedValue get(const Managed *m, StringOrSymbol *name, bool *hasProperty); static ReturnedValue getIndexed(const Managed *m, uint index, bool *hasProperty); }; @@ -250,7 +250,7 @@ public: V4_NEEDS_DESTROY // JS API - static ReturnedValue get(const Managed *m, String *name, bool *hasProperty); + static ReturnedValue get(const Managed *m, StringOrSymbol *name, bool *hasProperty); static ReturnedValue getIndexed(const Managed *m, uint index, bool *hasProperty); // C++ API @@ -904,9 +904,14 @@ ReturnedValue NamedNodeMap::getIndexed(const Managed *m, uint index, bool *hasPr return Encode::undefined(); } -ReturnedValue NamedNodeMap::get(const Managed *m, String *name, bool *hasProperty) +ReturnedValue NamedNodeMap::get(const Managed *m, StringOrSymbol *n, bool *hasProperty) { Q_ASSERT(m->as<NamedNodeMap>()); + + if (n->isSymbol()) + return Object::get(m, n, hasProperty); + String *name = static_cast<String *>(n); + const NamedNodeMap *r = static_cast<const NamedNodeMap *>(m); QV4::ExecutionEngine *v4 = r->engine(); @@ -949,7 +954,7 @@ ReturnedValue NodeList::getIndexed(const Managed *m, uint index, bool *hasProper return Encode::undefined(); } -ReturnedValue NodeList::get(const Managed *m, String *name, bool *hasProperty) +ReturnedValue NodeList::get(const Managed *m, StringOrSymbol *name, bool *hasProperty) { Q_ASSERT(m->as<NodeList>()); const NodeList *r = static_cast<const NodeList *>(m); @@ -957,7 +962,7 @@ ReturnedValue NodeList::get(const Managed *m, String *name, bool *hasProperty) name->makeIdentifier(); - if (name->equals(v4->id_length())) + if (name->identifier() == v4->id_length()->identifier()) return Primitive::fromInt32(r->d()->d->children.count()).asReturnedValue(); return Object::get(m, name, hasProperty); } |