aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types/qquickworkerscript.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-11-12 13:55:55 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-11-15 13:16:28 +0100
commit3dc7b5ddf6de5d9d000f443170d9a33e3d32bda3 (patch)
treebdf725cac352f9d83a6b8d7a4308c867ef2e20e0 /src/qml/types/qquickworkerscript.cpp
parentcd6db04169dcd0f7b49f5875d3c63d94fa32e17a (diff)
Cleanup exception catching code
Change-Id: I85afd5758f72e19c280dc196601ee145f0c25f01 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/types/qquickworkerscript.cpp')
-rw-r--r--src/qml/types/qquickworkerscript.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp
index f2705aca44..1640a1ffcf 100644
--- a/src/qml/types/qquickworkerscript.cpp
+++ b/src/qml/types/qquickworkerscript.cpp
@@ -244,7 +244,6 @@ QV4::ReturnedValue QQuickWorkerScriptEnginePrivate::WorkerEngine::sendFunction(i
QV4::Scope scope(v4);
QV4::ScopedFunctionObject f(scope, createsend.value());
- QV4::ExecutionContext *ctx = v4->currentContext();
QV4::ScopedValue v(scope);
QV4::ScopedCallData callData(scope, 1);
@@ -252,7 +251,7 @@ QV4::ReturnedValue QQuickWorkerScriptEnginePrivate::WorkerEngine::sendFunction(i
callData->thisObject = global();
v = f->call(callData);
if (scope.hasException())
- v = ctx->catchException();
+ v = scope.engine->catchException();
return v.asReturnedValue();
}
@@ -352,7 +351,6 @@ void QQuickWorkerScriptEnginePrivate::processMessage(int id, const QByteArray &d
QV4::ExecutionEngine *v4 = QV8Engine::getV4(workerEngine);
QV4::Scope scope(v4);
QV4::ScopedFunctionObject f(scope, workerEngine->onmessage.value());
- QV4::ExecutionContext *ctx = v4->currentContext();
QV4::ScopedValue value(scope, QV4::Serialize::deserialize(data, workerEngine));
@@ -362,7 +360,7 @@ void QQuickWorkerScriptEnginePrivate::processMessage(int id, const QByteArray &d
callData->args[1] = value;
f->call(callData);
if (scope.hasException()) {
- QQmlError error = QV4::ExecutionEngine::catchExceptionAsQmlError(ctx);
+ QQmlError error = scope.engine->catchExceptionAsQmlError();
reportScriptException(script, error);
}
}
@@ -409,8 +407,7 @@ void QQuickWorkerScriptEnginePrivate::processLoad(int id, const QUrl &url)
program->run();
if (v4->hasException) {
- QV4::ExecutionContext *ctx = v4->currentContext();
- QQmlError error = QV4::ExecutionEngine::catchExceptionAsQmlError(ctx);
+ QQmlError error = v4->catchExceptionAsQmlError();
reportScriptException(script, error);
}
}