diff options
Diffstat (limited to 'src/qml/jsapi')
-rw-r--r-- | src/qml/jsapi/qjsengine.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qml/jsapi/qjsengine.cpp b/src/qml/jsapi/qjsengine.cpp index d1bd4934cd..5d8a0202fa 100644 --- a/src/qml/jsapi/qjsengine.cpp +++ b/src/qml/jsapi/qjsengine.cpp @@ -262,15 +262,15 @@ QJSValue QJSEngine::evaluate(const QString& program, const QString& fileName, in QV4::Scope scope(d->m_v4Engine); QV4::ExecutionContext *ctx = d->m_v4Engine->current; QV4::ScopedValue result(scope); - try { - QV4::Script script(ctx, program, fileName, lineNumber); - script.strictMode = ctx->strictMode; - script.inheritContext = true; - script.parse(); + + QV4::Script script(ctx, program, fileName, lineNumber); + script.strictMode = ctx->strictMode; + script.inheritContext = true; + script.parse(); + if (!scope.engine->hasException) result = script.run(); - } catch (...) { + if (scope.engine->hasException) result = ctx->catchException(); - } return new QJSValuePrivate(d->m_v4Engine, result); } |