summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/script/api/qscriptengine.cpp1
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp7
2 files changed, 8 insertions, 0 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 179a49f..3378da9 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -2150,6 +2150,7 @@ QScriptValue QScriptEngine::evaluate(const QString &program, const QString &file
JSC::JSValue thisValue = d->thisForContext(exec);
JSC::JSObject* thisObject = (!thisValue || thisValue.isUndefinedOrNull()) ? exec->dynamicGlobalObject() : thisValue.toObject(exec);
JSC::JSValue exceptionValue;
+ dynamic_cast<QScript::TimeoutCheckerProxy*>(d->globalData->timeoutChecker)->setShouldAbort(false);
JSC::JSValue result = exec->interpreter()->execute(evalNode.get(), exec, thisObject, exec->scopeChain(), &exceptionValue);
if (dynamic_cast<QScript::TimeoutCheckerProxy*>(d->globalData->timeoutChecker)->shouldAbort()) {
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index f7bac56..06be924 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -2536,6 +2536,13 @@ void tst_QScriptEngine::abortEvaluation()
eng.abortEvaluation();
QVERIFY(!eng.hasUncaughtException());
+ eng.abortEvaluation(123);
+ {
+ QScriptValue ret = eng.evaluate("'ciao'");
+ QVERIFY(ret.isString());
+ QCOMPARE(ret.toString(), QString::fromLatin1("ciao"));
+ }
+
EventReceiver3 receiver(&eng);
eng.setProcessEventsInterval(100);