summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/api/qscriptengine.cpp')
-rw-r--r--src/script/api/qscriptengine.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 07aced4..128e9c3 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -46,6 +46,7 @@
#include "Error.h"
#include "Interpreter.h"
+#include "ExceptionHelpers.h"
#include "PrototypeFunction.h"
#include "InitializeThreading.h"
#include "ObjectPrototype.h"
@@ -4116,9 +4117,11 @@ bool QScriptEngine::isEvaluating() const
void QScriptEngine::abortEvaluation(const QScriptValue &result)
{
Q_D(QScriptEngine);
-
- d->timeoutChecker()->setShouldAbort(true);
+ if (!isEvaluating())
+ return;
d->abortResult = result;
+ d->timeoutChecker()->setShouldAbort(true);
+ JSC::throwError(d->currentFrame, JSC::createInterruptedExecutionException(&d->currentFrame->globalData()).toObject(d->currentFrame));
}
#ifndef QT_NO_QOBJECT