aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types/qquickworkerscript.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-10-22 14:32:03 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-29 10:39:04 +0100
commit25fbdfc66fa995bfe633b3c31d635045f7cf66dd (patch)
tree3264a851680476ebb7f161d5a38dcff3182a0e8a /src/qml/types/qquickworkerscript.cpp
parentffcdbfa03f8bb36b521f8c1a703ee24085fe25bd (diff)
Fix the remaining try/catch statements in C++
Change-Id: I2421dc48fb271b66bd476fb16a32a88fcc4c5177 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/types/qquickworkerscript.cpp')
-rw-r--r--src/qml/types/qquickworkerscript.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp
index c0f6c737b2..78dbeb9d4f 100644
--- a/src/qml/types/qquickworkerscript.cpp
+++ b/src/qml/types/qquickworkerscript.cpp
@@ -255,14 +255,12 @@ QV4::ReturnedValue QQuickWorkerScriptEnginePrivate::WorkerEngine::sendFunction(i
QV4::ExecutionContext *ctx = v4->current;
QV4::ScopedValue v(scope);
- try {
- QV4::ScopedCallData callData(scope, 1);
- callData->args[0] = QV4::Primitive::fromInt32(id);
- callData->thisObject = global();
- v = f->call(callData);
- } catch (...) {
+ QV4::ScopedCallData callData(scope, 1);
+ callData->args[0] = QV4::Primitive::fromInt32(id);
+ callData->thisObject = global();
+ v = f->call(callData);
+ if (scope.hasException())
v = ctx->catchException();
- }
return v.asReturnedValue();
}
@@ -362,13 +360,12 @@ void QQuickWorkerScriptEnginePrivate::processMessage(int id, const QByteArray &d
QV4::ScopedValue value(scope, QV4::Serialize::deserialize(data, workerEngine));
- try {
- QV4::ScopedCallData callData(scope, 2);
- callData->thisObject = workerEngine->global();
- callData->args[0] = script->object.value();
- callData->args[1] = value;
- f->call(callData);
- } catch (...) {
+ QV4::ScopedCallData callData(scope, 2);
+ callData->thisObject = workerEngine->global();
+ callData->args[0] = script->object.value();
+ callData->args[1] = value;
+ f->call(callData);
+ if (scope.hasException()) {
QQmlError error = QV4::ExecutionEngine::catchExceptionAsQmlError(ctx);
reportScriptException(script, error);
}