From 3dc7b5ddf6de5d9d000f443170d9a33e3d32bda3 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 12 Nov 2014 13:55:55 +0100 Subject: Cleanup exception catching code Change-Id: I85afd5758f72e19c280dc196601ee145f0c25f01 Reviewed-by: Simon Hausmann --- src/qml/types/qquickworkerscript.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/qml/types/qquickworkerscript.cpp') 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); } } -- cgit v1.2.3