diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2014-10-31 20:20:43 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2014-10-31 20:21:09 +0100 |
commit | 473ef83dba6976250a1ff27175716aa1af970f2f (patch) | |
tree | 922044c8be598f76945af1599196c7f379df280e /src/qml/qml/qqmlxmlhttprequest.cpp | |
parent | beb6667d4e65dfe2ec9e7f554837524416c0f4dc (diff) | |
parent | 0704d2be63b484cb579c1507223db3f914b1338a (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: I30f9c925631991ceb22339d1333936faecffbaf4
Diffstat (limited to 'src/qml/qml/qqmlxmlhttprequest.cpp')
-rw-r--r-- | src/qml/qml/qqmlxmlhttprequest.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index 233dd9c239..9e0a1872be 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -204,7 +204,7 @@ public: // JS API static void destroy(Managed *that) { - that->as<NamedNodeMap>()->d()->~Data(); + static_cast<NamedNodeMap *>(that)->d()->~Data(); } static ReturnedValue get(Managed *m, String *name, bool *hasProperty); static ReturnedValue getIndexed(Managed *m, uint index, bool *hasProperty); @@ -235,7 +235,7 @@ public: // JS API static void destroy(Managed *that) { - that->as<NodeList>()->d()->~Data(); + static_cast<NodeList *>(that)->d()->~Data(); } static ReturnedValue get(Managed *m, String *name, bool *hasProperty); static ReturnedValue getIndexed(Managed *m, uint index, bool *hasProperty); @@ -325,7 +325,7 @@ struct Node : public Object // JS API static void destroy(Managed *that) { - that->as<Node>()->d()->~Data(); + static_cast<Node *>(that)->d()->~Data(); } // C++ API @@ -917,10 +917,9 @@ ReturnedValue NamedNodeMap::getIndexed(Managed *m, uint index, bool *hasProperty ReturnedValue NamedNodeMap::get(Managed *m, String *name, bool *hasProperty) { - NamedNodeMap *r = m->as<NamedNodeMap>(); + Q_ASSERT(m->as<NamedNodeMap>()); + NamedNodeMap *r = static_cast<NamedNodeMap *>(m); QV4::ExecutionEngine *v4 = m->engine(); - if (!r) - return v4->currentContext()->throwTypeError(); name->makeIdentifier(); if (name->equals(v4->id_length)) @@ -950,13 +949,9 @@ ReturnedValue NamedNodeMap::create(QV8Engine *engine, NodeImpl *data, const QLis ReturnedValue NodeList::getIndexed(Managed *m, uint index, bool *hasProperty) { + Q_ASSERT(m->as<NodeList>()); QV4::ExecutionEngine *v4 = m->engine(); - NodeList *r = m->as<NodeList>(); - if (!r) { - if (hasProperty) - *hasProperty = false; - return v4->currentContext()->throwTypeError(); - } + NodeList *r = static_cast<NodeList *>(m); QV8Engine *engine = v4->v8Engine; @@ -972,10 +967,9 @@ ReturnedValue NodeList::getIndexed(Managed *m, uint index, bool *hasProperty) ReturnedValue NodeList::get(Managed *m, String *name, bool *hasProperty) { + Q_ASSERT(m->as<NodeList>()); QV4::ExecutionEngine *v4 = m->engine(); - NodeList *r = m->as<NodeList>(); - if (!r) - return v4->currentContext()->throwTypeError(); + NodeList *r = static_cast<NodeList *>(m); name->makeIdentifier(); @@ -1616,7 +1610,7 @@ struct QQmlXMLHttpRequestWrapper : public Object V4_OBJECT(Object) static void destroy(Managed *that) { - that->as<QQmlXMLHttpRequestWrapper>()->d()->~Data(); + static_cast<QQmlXMLHttpRequestWrapper *>(that)->d()->~Data(); } }; @@ -1646,7 +1640,7 @@ struct QQmlXMLHttpRequestCtor : public FunctionObject }; V4_OBJECT(FunctionObject) static void markObjects(Managed *that, ExecutionEngine *e) { - QQmlXMLHttpRequestCtor *c = that->as<QQmlXMLHttpRequestCtor>(); + QQmlXMLHttpRequestCtor *c = static_cast<QQmlXMLHttpRequestCtor *>(that); if (c->d()->proto) c->d()->proto->mark(e); FunctionObject::markObjects(that, e); |