summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2013-08-30 14:06:02 +0200
committerChristian Kandeler <christian.kandeler@digia.com>2013-08-30 14:40:05 +0200
commitd68eb98d1e50bcc99dd5cc17e465ef1929d9e400 (patch)
treeb915b552ee3fc9e6da3de4cc47e0292a9b3aca84 /src
parentb3a23fc7aa6a125a1604f40e2311e5d19aefde55 (diff)
downloadqbs-d68eb98d1e50bcc99dd5cc17e465ef1929d9e400.tar.gz
fix JS exception handling in evaluator
This fixes the case where the return value of evaluate is a value but an internal exception is thrown. Change-Id: I01edcd6bc64de176da5da3a499c594db45eee789 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/language/evaluator.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/language/evaluator.cpp b/src/lib/language/evaluator.cpp
index 036958d5f..256f38e24 100644
--- a/src/lib/language/evaluator.cpp
+++ b/src/lib/language/evaluator.cpp
@@ -189,8 +189,10 @@ void Evaluator::handleEvaluationError(const Item *item, const QString &name,
return;
const ValueConstPtr value = item->property(name);
CodeLocation location = value ? value->location() : CodeLocation();
- if (m_scriptEngine->hasUncaughtException())
- location = CodeLocation(location.fileName(), m_scriptEngine->uncaughtExceptionLineNumber());
+ if (m_scriptEngine->hasUncaughtException()) {
+ throw ErrorInfo(m_scriptEngine->uncaughtException().toString(),
+ CodeLocation(location.fileName(), m_scriptEngine->uncaughtExceptionLineNumber()));
+ }
throw ErrorInfo(scriptValue.toString(), location);
}