diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-11-12 13:55:55 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-11-15 13:16:28 +0100 |
commit | 3dc7b5ddf6de5d9d000f443170d9a33e3d32bda3 (patch) | |
tree | bdf725cac352f9d83a6b8d7a4308c867ef2e20e0 /src/qml/jsruntime/qv4include.cpp | |
parent | cd6db04169dcd0f7b49f5875d3c63d94fa32e17a (diff) |
Cleanup exception catching code
Change-Id: I85afd5758f72e19c280dc196601ee145f0c25f01
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4include.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4include.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4include.cpp b/src/qml/jsruntime/qv4include.cpp index 60ac519dfb..67282f25ac 100644 --- a/src/qml/jsruntime/qv4include.cpp +++ b/src/qml/jsruntime/qv4include.cpp @@ -100,13 +100,12 @@ void QV4Include::callback(const QV4::ValueRef callback, const QV4::ValueRef stat if (!f) return; - QV4::ExecutionContext *ctx = v4->currentContext(); QV4::ScopedCallData callData(scope, 1); callData->thisObject = v4->globalObject->asReturnedValue(); callData->args[0] = status; f->call(callData); if (scope.hasException()) - ctx->catchException(); + scope.engine->catchException(); } QV4::ReturnedValue QV4Include::result() @@ -146,12 +145,11 @@ void QV4Include::finished() QV4::ScopedObject qmlglobal(scope, m_qmlglobal.value()); QV4::Script script(v4, qmlglobal, code, m_url.toString()); - QV4::ExecutionContext *ctx = v4->currentContext(); script.parse(); if (!scope.engine->hasException) script.run(); if (scope.engine->hasException) { - QV4::ScopedValue ex(scope, ctx->catchException()); + QV4::ScopedValue ex(scope, scope.engine->catchException()); resultObj->put(status.getPointer(), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(Exception))); QV4::ScopedString exception(scope, v4->newString(QStringLiteral("exception"))); resultObj->put(exception.getPointer(), ex); @@ -220,12 +218,11 @@ QV4::ReturnedValue QV4Include::method_include(QV4::CallContext *ctx) } if (!script.isNull()) { - QV4::ExecutionContext *ctx = scope.engine->currentContext(); script->parse(); if (!scope.engine->hasException) script->run(); if (scope.engine->hasException) { - QV4::ScopedValue ex(scope, ctx->catchException()); + QV4::ScopedValue ex(scope, scope.engine->catchException()); result = resultValue(scope.engine, Exception); QV4::ScopedString exception(scope, scope.engine->newString(QStringLiteral("exception"))); result->asObject()->put(exception.getPointer(), ex); |