diff options
Diffstat (limited to 'src/script/api/qscriptengine.cpp')
-rw-r--r-- | src/script/api/qscriptengine.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index f44f33d..91c06f6 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -49,6 +49,7 @@ #include "DateConstructor.h" #include "RegExpConstructor.h" +#include "ExceptionHelpers.h" #include "PrototypeFunction.h" #include "InitializeThreading.h" #include "ObjectPrototype.h" @@ -3547,9 +3548,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 |