diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-11-21 16:41:32 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-04 09:45:50 +0100 |
commit | 9306c05dd152511b8b938d7899a7bdf1aeb8d1c2 (patch) | |
tree | 514b6cda632244d7f9e7fdb1af143da05b7b1ce0 /src/qml/qml/qqmlxmlhttprequest.cpp | |
parent | 0f32303e5cc9c539aa8698cab2b8cc2e946d885a (diff) |
Encapsulate the current context and fix it's usage
Encapsulate accesses to the current context, and rework
the way we push and pop this context from the context
stack.
Largely a cleanup, but simplifies the code in the long term
Change-Id: I409e378490d0ab027be6a4c01a4031b2ea35c51d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlxmlhttprequest.cpp')
-rw-r--r-- | src/qml/qml/qqmlxmlhttprequest.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index e31b1c414a..ad231d0769 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -906,7 +906,7 @@ ReturnedValue NamedNodeMap::getIndexed(Managed *m, uint index, bool *hasProperty QV4::ExecutionEngine *v4 = m->engine(); NamedNodeMap *r = m->as<NamedNodeMap>(); if (!r) - return v4->current->throwTypeError(); + return v4->currentContext()->throwTypeError(); QV8Engine *engine = v4->v8Engine; @@ -925,7 +925,7 @@ ReturnedValue NamedNodeMap::get(Managed *m, const StringRef name, bool *hasPrope NamedNodeMap *r = m->as<NamedNodeMap>(); QV4::ExecutionEngine *v4 = m->engine(); if (!r) - return v4->current->throwTypeError(); + return v4->currentContext()->throwTypeError(); name->makeIdentifier(); if (name->equals(v4->id_length)) @@ -961,7 +961,7 @@ ReturnedValue NodeList::getIndexed(Managed *m, uint index, bool *hasProperty) QV4::ExecutionEngine *v4 = m->engine(); NodeList *r = m->as<NodeList>(); if (!r) - return v4->current->throwTypeError(); + return v4->currentContext()->throwTypeError(); QV8Engine *engine = v4->v8Engine; @@ -980,7 +980,7 @@ ReturnedValue NodeList::get(Managed *m, const StringRef name, bool *hasProperty) QV4::ExecutionEngine *v4 = m->engine(); NodeList *r = m->as<NodeList>(); if (!r) - return v4->current->throwTypeError(); + return v4->currentContext()->throwTypeError(); name->makeIdentifier(); @@ -1535,7 +1535,7 @@ const QByteArray &QQmlXMLHttpRequest::rawResponseBody() const void QQmlXMLHttpRequest::dispatchCallbackImpl(const ValueRef me) { - ExecutionContext *ctx = v4->current; + ExecutionContext *ctx = v4->currentContext(); QV4::Scope scope(v4); Scoped<Object> o(scope, me); if (!o) { @@ -1560,7 +1560,7 @@ void QQmlXMLHttpRequest::dispatchCallbackImpl(const ValueRef me) s = v4->newString(QStringLiteral("ActivationObject")); Scoped<Object> activationObject(scope, o->get(s)); if (!activationObject) { - v4->current->throwError(QStringLiteral("QQmlXMLHttpRequest: internal error: empty ActivationObject")); + v4->currentContext()->throwError(QStringLiteral("QQmlXMLHttpRequest: internal error: empty ActivationObject")); return; } @@ -1580,7 +1580,7 @@ void QQmlXMLHttpRequest::dispatchCallbackImpl(const ValueRef me) void QQmlXMLHttpRequest::dispatchCallback(const ValueRef me) { - ExecutionContext *ctx = v4->current; + ExecutionContext *ctx = v4->currentContext(); dispatchCallbackImpl(me); if (v4->hasException) { QQmlError error = QV4::ExecutionEngine::catchExceptionAsQmlError(ctx); @@ -1656,7 +1656,7 @@ struct QQmlXMLHttpRequestCtor : public FunctionObject Scope scope(that->engine()); Scoped<QQmlXMLHttpRequestCtor> ctor(scope, that->as<QQmlXMLHttpRequestCtor>()); if (!ctor) - return that->engine()->current->throwTypeError(); + return that->engine()->currentContext()->throwTypeError(); QV8Engine *engine = that->engine()->v8Engine; QQmlXMLHttpRequest *r = new QQmlXMLHttpRequest(engine, engine->networkAccessManager()); |