aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-11-13 12:14:09 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-11-21 16:36:24 +0100
commitb943d80dd90dec1a8b7802b826ad89e924cead05 (patch)
treea7edf71a76757a6dcb623e4929419a57a58a5523 /src/qml/qml
parentcf7bd35a93f220cb1348f7654df9c6f27b590790 (diff)
Remove the executioncontext in a few more places where it's not needed
Change-Id: I4c92c7bc9d94d8265e306f45d863fdc080a5e2a6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/qqmljavascriptexpression.cpp9
-rw-r--r--src/qml/qml/qqmljavascriptexpression_p.h6
-rw-r--r--src/qml/qml/qqmlxmlhttprequest.cpp5
3 files changed, 7 insertions, 13 deletions
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp
index 55fc193abd..6a3e0d4a73 100644
--- a/src/qml/qml/qqmljavascriptexpression.cpp
+++ b/src/qml/qml/qqmljavascriptexpression.cpp
@@ -76,9 +76,9 @@ void QQmlDelayedError::setErrorObject(QObject *object)
m_error.setObject(object);
}
-void QQmlDelayedError::catchJavaScriptException(QV4::ExecutionContext *context)
+void QQmlDelayedError::catchJavaScriptException(QV4::ExecutionEngine *engine)
{
- m_error = context->engine()->catchExceptionAsQmlError();
+ m_error = engine->catchExceptionAsQmlError();
}
@@ -147,10 +147,9 @@ QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QQmlContextData *context,
QV4::ExecutionEngine *v4 = QV8Engine::getV4(ep->v8engine());
QV4::Scope scope(v4);
QV4::ScopedValue result(scope, QV4::Primitive::undefinedValue());
- QV4::ExecutionContext *ctx = v4->currentContext();
callData->thisObject = v4->globalObject;
if (scopeObject()) {
- QV4::ScopedValue value(scope, QV4::QObjectWrapper::wrap(ctx->d()->engine, scopeObject()));
+ QV4::ScopedValue value(scope, QV4::QObjectWrapper::wrap(v4, scopeObject()));
if (value->isObject())
callData->thisObject = value;
}
@@ -160,7 +159,7 @@ QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QQmlContextData *context,
if (watcher.wasDeleted())
scope.engine->catchException(); // ignore exception
else
- delayedError()->catchJavaScriptException(ctx);
+ delayedError()->catchJavaScriptException(scope.engine);
if (isUndefined)
*isUndefined = true;
} else {
diff --git a/src/qml/qml/qqmljavascriptexpression_p.h b/src/qml/qml/qqmljavascriptexpression_p.h
index 2c78a745fc..dc48c2458d 100644
--- a/src/qml/qml/qqmljavascriptexpression_p.h
+++ b/src/qml/qml/qqmljavascriptexpression_p.h
@@ -52,10 +52,6 @@
QT_BEGIN_NAMESPACE
-namespace QV4 {
-struct ExecutionContext;
-}
-
class QQmlDelayedError
{
public:
@@ -81,7 +77,7 @@ public:
void setErrorObject(QObject *object);
// Call only from catch(...) -- will re-throw if no JS exception
- void catchJavaScriptException(QV4::ExecutionContext *context);
+ void catchJavaScriptException(QV4::ExecutionEngine *engine);
private:
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp
index 9b1607c7ad..0083d2353c 100644
--- a/src/qml/qml/qqmlxmlhttprequest.cpp
+++ b/src/qml/qml/qqmlxmlhttprequest.cpp
@@ -1547,18 +1547,17 @@ const QByteArray &QQmlXMLHttpRequest::rawResponseBody() const
void QQmlXMLHttpRequest::dispatchCallbackImpl(const ValueRef me)
{
- ExecutionContext *ctx = v4->currentContext();
QV4::Scope scope(v4);
Scoped<Object> o(scope, me);
if (!o) {
- ctx->engine()->throwError(QStringLiteral("QQmlXMLHttpRequest: internal error: empty ThisObject"));
+ v4->throwError(QStringLiteral("QQmlXMLHttpRequest: internal error: empty ThisObject"));
return;
}
ScopedString s(scope, v4->newString(QStringLiteral("ThisObject")));
Scoped<Object> thisObj(scope, o->get(s.getPointer()));
if (!thisObj) {
- ctx->engine()->throwError(QStringLiteral("QQmlXMLHttpRequest: internal error: empty ThisObject"));
+ v4->throwError(QStringLiteral("QQmlXMLHttpRequest: internal error: empty ThisObject"));
return;
}