aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index cf39d7df4f..bb11011669 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -808,7 +808,13 @@ QmlExtensions *ExecutionEngine::qmlExtensions()
ReturnedValue ExecutionEngine::throwException(const ValueRef value)
{
-// Q_ASSERT(!hasException);
+ // we can get in here with an exception already set, as the runtime
+ // doesn't check after every operation that can throw.
+ // in this case preserve the first exception to give correct error
+ // information
+ if (hasException)
+ return Encode::undefined();
+
hasException = true;
exceptionValue = value;
QV4::Scope scope(this);