Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 72 files). Show all
Unified · Split
| @@ -314,8 +314,9 @@ void ScriptEngine::evaluate() { · 313 unmodified lines | |||
| 314 | 314 | ||
| 315 | if (_engine.hasUncaughtException()) { | 315 | if (_engine.hasUncaughtException()) { |
| 316 | int line = _engine.uncaughtExceptionLineNumber(); | 316 | int line = _engine.uncaughtExceptionLineNumber(); |
| 317 | qDebug() << "Uncaught exception at line" << line << ":" << result.toString(); | 317 | qDebug() << "Uncaught exception at (" << _fileNameString << ") line" << line << ":" << result.toString(); |
| 318 | emit errorMessage("Uncaught exception at line" + QString::number(line) + ":" + result.toString()); | 318 | emit errorMessage("Uncaught exception at (" + _fileNameString + ") line" + QString::number(line) + ":" + result.toString()); |
| 319 | _engine.clearExceptions(); | ||
| 319 | } | 320 | } |
| 320 | } | 321 | } |
| 321 | 322 | ||
| @@ -324,7 +325,7 @@ QScriptValue ScriptEngine::evaluate(const QString& program, const QString& fileN · 2 unmodified lines | |||
| 324 | bool hasUncaughtException = _engine.hasUncaughtException(); | 325 | bool hasUncaughtException = _engine.hasUncaughtException(); |
| 325 | if (hasUncaughtException) { | 326 | if (hasUncaughtException) { |
| 326 | int line = _engine.uncaughtExceptionLineNumber(); | 327 | int line = _engine.uncaughtExceptionLineNumber(); |
| 327 | qDebug() << "Uncaught exception at line" << line << ": " << result.toString(); | 328 | qDebug() << "Uncaught exception at (" << _fileNameString << ") line" << line << ": " << result.toString(); |
| 328 | } | 329 | } |
| 329 | emit evaluationFinished(result, hasUncaughtException); | 330 | emit evaluationFinished(result, hasUncaughtException); |
| 330 | _engine.clearExceptions(); | 331 | _engine.clearExceptions(); |
| @@ -353,9 +354,9 @@ void ScriptEngine::run() { · 22 unmodified lines | |||
| 353 | QScriptValue result = _engine.evaluate(_scriptContents); | 354 | QScriptValue result = _engine.evaluate(_scriptContents); |
| 354 | if (_engine.hasUncaughtException()) { | 355 | if (_engine.hasUncaughtException()) { |
| 355 | int line = _engine.uncaughtExceptionLineNumber(); | 356 | int line = _engine.uncaughtExceptionLineNumber(); |
| 356 | 357 | qDebug() << "Uncaught exception at (" << _fileNameString << ") line" << line << ":" << result.toString(); | |
| 357 | qDebug() << "Uncaught exception at line" << line << ":" << result.toString(); | 358 | emit errorMessage("Uncaught exception at (" + _fileNameString + ") line" + QString::number(line) + ":" + result.toString()); |
| 358 | emit errorMessage("Uncaught exception at line" + QString::number(line) + ":" + result.toString()); | 359 | _engine.clearExceptions(); |
| 359 | } | 360 | } |
| 360 | 361 | ||
| 361 | QElapsedTimer startTime; | 362 | QElapsedTimer startTime; |
| @@ -511,8 +512,9 @@ void ScriptEngine::run() { · 149 unmodified lines | |||
| 511 | 512 | ||
| 512 | if (_engine.hasUncaughtException()) { | 513 | if (_engine.hasUncaughtException()) { |
| 513 | int line = _engine.uncaughtExceptionLineNumber(); | 514 | int line = _engine.uncaughtExceptionLineNumber(); |
| 514 | qDebug() << "Uncaught exception at line" << line << ":" << _engine.uncaughtException().toString(); | 515 | qDebug() << "Uncaught exception at (" << _fileNameString << ") line" << line << ":" << _engine.uncaughtException().toString(); |
| 515 | emit errorMessage("Uncaught exception at line" + QString::number(line) + ":" + _engine.uncaughtException().toString()); | 516 | emit errorMessage("Uncaught exception at (" + _fileNameString + ") line" + QString::number(line) + ":" + _engine.uncaughtException().toString()); |
| 517 | _engine.clearExceptions(); | ||
| 516 | } | 518 | } |
| 517 | } | 519 | } |
| 518 | emit scriptEnding(); | 520 | emit scriptEnding(); |
| @@ -672,6 +674,7 @@ void ScriptEngine::include(const QString& includeFile) { · 153 unmodified lines | |||
| 672 | int line = _engine.uncaughtExceptionLineNumber(); | 674 | int line = _engine.uncaughtExceptionLineNumber(); |
| 673 | qDebug() << "Uncaught exception at (" << includeFile << ") line" << line << ":" << result.toString(); | 675 | qDebug() << "Uncaught exception at (" << includeFile << ") line" << line << ":" << result.toString(); |
| 674 | emit errorMessage("Uncaught exception at (" + includeFile + ") line" + QString::number(line) + ":" + result.toString()); | 676 | emit errorMessage("Uncaught exception at (" + includeFile + ") line" + QString::number(line) + ":" + result.toString()); |
| 677 | _engine.clearExceptions(); | ||
| 675 | } | 678 | } |
| 676 | } | 679 | } |
| 677 | 680 | ||