aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4include.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-04-24 18:05:46 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-06-30 11:23:08 +0200
commit8635e5b300298c01ada7dc51bfca76c3f02bfc14 (patch)
treef7e797d9ab242c82659258ff4829a7e2a65ee1ed /src/qml/jsruntime/qv4include.cpp
parent88e2b6316effd0a570b49e7e9f6f6378078c12a4 (diff)
Use QV4::Scope::hasException() where applicable
It is shorter and encapsulates the exception handling a bit. Change-Id: I8e2dc0eb3b930e222b8cb4852b73d99ca18a0379 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4include.cpp')
-rw-r--r--src/qml/jsruntime/qv4include.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4include.cpp b/src/qml/jsruntime/qv4include.cpp
index 3e6417af57..2eb773bd75 100644
--- a/src/qml/jsruntime/qv4include.cpp
+++ b/src/qml/jsruntime/qv4include.cpp
@@ -173,9 +173,9 @@ void QV4Include::finished()
QV4::Script script(v4, qml, /*parse as QML binding*/false, code, m_url.toString());
script.parse();
- if (!scope.engine->hasException)
+ if (!scope.hasException())
script.run();
- if (scope.engine->hasException) {
+ if (scope.hasException()) {
QV4::ScopedValue ex(scope, scope.engine->catchException());
resultObj->put(status, QV4::ScopedValue(scope, QV4::Value::fromInt32(Exception)));
QV4::ScopedString exception(scope, v4->newString(QStringLiteral("exception")));
@@ -245,9 +245,9 @@ QJSValue QV4Include::method_include(QV4::ExecutionEngine *engine, const QUrl &ur
if (!script.isNull()) {
script->parse();
- if (!scope.engine->hasException)
+ if (!scope.hasException())
script->run();
- if (scope.engine->hasException) {
+ if (scope.hasException()) {
QV4::ScopedValue ex(scope, scope.engine->catchException());
result = resultValue(scope.engine, Exception);
QV4::ScopedString exception(scope, scope.engine->newString(QStringLiteral("exception")));