aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v8/qv4domerrors_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-10-21 09:57:58 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-29 10:38:59 +0100
commitaf22149dd8daf593182fec978f15dc1667c9cf8d (patch)
tree17334ae83a3015fd6ca535fb9d2e97b40e1da825 /src/qml/qml/v8/qv4domerrors_p.h
parent2b996ca17fbc36029af3900933b6fcc1418afb6a (diff)
Avoid side effects when en exception has been thrown.
We don't want to check for exceptions after every single line on our runtime methods. A better way to handle this is to add the check in all methods that have direct side effects (as e.g. writing to a property of the JS stack). We also need to return whereever we throw an exception. To simplify the code, ExecutionContext::throwXxx methods now return a ReturnedValue (always undefined) for convenience. Change-Id: Ide6c804f819c731a3f14c6c43121d08029c9fb90 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/v8/qv4domerrors_p.h')
-rw-r--r--src/qml/qml/v8/qv4domerrors_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/v8/qv4domerrors_p.h b/src/qml/qml/v8/qv4domerrors_p.h
index 44662e8cba..faf52ce1ad 100644
--- a/src/qml/qml/v8/qv4domerrors_p.h
+++ b/src/qml/qml/v8/qv4domerrors_p.h
@@ -80,7 +80,7 @@ QT_BEGIN_NAMESPACE
QV4::ScopedValue v(scope, ctx->engine->newString(QStringLiteral(string))); \
QV4::Scoped<Object> ex(scope, ctx->engine->newErrorObject(v)); \
ex->put(QV4::ScopedString(scope, ctx->engine->newIdentifier(QStringLiteral("code"))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(error))); \
- ctx->throwError(ex); \
+ return ctx->throwError(ex); \
}
namespace QV4 {