Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 46 files). Show all
Unified · Split
| @@ -96,7 +96,7 @@ static bool hasCorrectSyntax(const QScriptProgram& program) { · 95 unmodified lines | ||
| 96 | 96 | return true; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | −static bool hadUncauchtExceptions(QScriptEngine& engine, const QString& fileName) { | |
| 99 | +static bool hadUncaughtExceptions(QScriptEngine& engine, const QString& fileName) { | |
| 100 | 100 | if (engine.hasUncaughtException()) { |
| 101 | 101 | const auto backtrace = engine.uncaughtExceptionBacktrace(); |
| 102 | 102 | const auto exception = engine.uncaughtException().toString(); |
| @@ -616,7 +616,7 @@ QScriptValue ScriptEngine::evaluate(const QString& sourceCode, const QString& fi · 513 unmodified lines | ||
| 616 | 616 | const auto result = QScriptEngine::evaluate(program); |
| 617 | 617 | --_evaluatesPending; |
| 618 | 618 | |
| 619 | − const auto hadUncaughtException = hadUncauchtExceptions(*this, program.fileName()); | |
| 619 | + const auto hadUncaughtException = hadUncaughtExceptions(*this, program.fileName()); | |
| 620 | 620 | if (_wantSignals) { |
| 621 | 621 | emit evaluationFinished(result, hadUncaughtException); |
| 622 | 622 | } |
| @@ -684,10 +684,9 @@ void ScriptEngine::run() { · 61 unmodified lines | ||
| 684 | 684 | } |
| 685 | 685 | } |
| 686 | 686 | lastUpdate = now; |
| 687 | − | |
| 688 | − if (hadUncauchtExceptions(*this, _fileNameString)) { | |
| 689 | − stop(); | |
| 690 | − } | |
| 687 | + | |
| 688 | + // Debug and clear exceptions | |
| 689 | + hadUncaughtExceptions(*this, _fileNameString); | |
| 691 | 690 | } |
| 692 | 691 | |
| 693 | 692 | stopAllTimers(); // make sure all our timers are stopped if the script is ending |
| @@ -1022,7 +1021,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 328 unmodified lines | ||
| 1022 | 1021 | |
| 1023 | 1022 | QScriptEngine sandbox; |
| 1024 | 1023 | QScriptValue testConstructor = sandbox.evaluate(program); |
| 1025 | − if (hadUncauchtExceptions(sandbox, program.fileName())) { | |
| 1024 | + if (hadUncaughtExceptions(sandbox, program.fileName())) { | |
| 1026 | 1025 | return; |
| 1027 | 1026 | } |
| 1028 | 1027 | |