Showing the changes to libraries/script-engine/src/ConsoleScriptingInterface.cpp (1 of 9 files). Show all
Unified · Split
| @@ -84,7 +84,7 @@ void ConsoleScriptingInterface::time(QString labelName) { · 83 unmodified lines | |||
| 84 | QString message = QString("%1: Timer started").arg(labelName); | 84 | QString message = QString("%1: Timer started").arg(labelName); |
| 85 | Q_ASSERT(engine); | 85 | Q_ASSERT(engine); |
| 86 | if (ScriptManager* scriptManager = engine()->manager()) { | 86 | if (ScriptManager* scriptManager = engine()->manager()) { |
| 87 | scriptManager->scriptPrintedMessage(message); | 87 | scriptManager->scriptPrintedMessage(message, context()->currentFileName(), context()->currentLineNumber()); |
| 88 | } | 88 | } |
| 89 | } | 89 | } |
| 90 | 90 | ||
| @@ -92,13 +92,13 @@ void ConsoleScriptingInterface::timeEnd(QString labelName) { · 1 unmodified line | |||
| 92 | Q_ASSERT(engine); | 92 | Q_ASSERT(engine); |
| 93 | if (ScriptManager* scriptManager = engine()->manager()) { | 93 | if (ScriptManager* scriptManager = engine()->manager()) { |
| 94 | if (!_timerDetails.contains(labelName)) { | 94 | if (!_timerDetails.contains(labelName)) { |
| 95 | scriptManager->scriptErrorMessage("No such label found " + labelName); | 95 | scriptManager->scriptErrorMessage("No such label found " + labelName, context()->currentFileName(), context()->currentLineNumber()); |
| 96 | return; | 96 | return; |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | if (_timerDetails.value(labelName).isNull()) { | 99 | if (_timerDetails.value(labelName).isNull()) { |
| 100 | _timerDetails.remove(labelName); | 100 | _timerDetails.remove(labelName); |
| 101 | scriptManager->scriptErrorMessage("Invalid start time for " + labelName); | 101 | scriptManager->scriptErrorMessage("Invalid start time for " + labelName, context()->currentFileName(), context()->currentLineNumber()); |
| 102 | return; | 102 | return; |
| 103 | } | 103 | } |
| 104 | QDateTime _startTime = _timerDetails.value(labelName); | 104 | QDateTime _startTime = _timerDetails.value(labelName); |
| @@ -108,7 +108,7 @@ void ConsoleScriptingInterface::timeEnd(QString labelName) { · 3 unmodified lines | |||
| 108 | QString message = QString("%1: %2ms").arg(labelName).arg(QString::number(diffInMS)); | 108 | QString message = QString("%1: %2ms").arg(labelName).arg(QString::number(diffInMS)); |
| 109 | _timerDetails.remove(labelName); | 109 | _timerDetails.remove(labelName); |
| 110 | 110 | ||
| 111 | scriptManager->scriptPrintedMessage(message); | 111 | scriptManager->scriptPrintedMessage(message, context()->currentFileName(), context()->currentLineNumber()); |
| 112 | } | 112 | } |
| 113 | } | 113 | } |
| 114 | 114 | ||
| @@ -131,7 +131,7 @@ ScriptValue ConsoleScriptingInterface::assertion(ScriptContext* context, ScriptE · 16 unmodified lines | |||
| 131 | assertionResult = QString("Assertion failed : %1").arg(message); | 131 | assertionResult = QString("Assertion failed : %1").arg(message); |
| 132 | } | 132 | } |
| 133 | if (ScriptManager* scriptManager = engine->manager()) { | 133 | if (ScriptManager* scriptManager = engine->manager()) { |
| 134 | scriptManager->scriptErrorMessage(assertionResult); | 134 | scriptManager->scriptErrorMessage(assertionResult, context->currentFileName(), context->currentLineNumber()); |
| 135 | } | 135 | } |
| 136 | } | 136 | } |
| 137 | return engine->nullValue(); | 137 | return engine->nullValue(); |
| @@ -143,7 +143,7 @@ void ConsoleScriptingInterface::trace() { · 5 unmodified lines | |||
| 143 | if (ScriptManager* scriptManager = scriptEngine->manager()) { | 143 | if (ScriptManager* scriptManager = scriptEngine->manager()) { |
| 144 | scriptManager->scriptPrintedMessage | 144 | scriptManager->scriptPrintedMessage |
| 145 | (QString(STACK_TRACE_FORMAT).arg(LINE_SEPARATOR, | 145 | (QString(STACK_TRACE_FORMAT).arg(LINE_SEPARATOR, |
| 146 | scriptEngine->currentContext()->backtrace().join(LINE_SEPARATOR))); | 146 | scriptEngine->currentContext()->backtrace().join(LINE_SEPARATOR)), context()->currentFileName(), context()->currentLineNumber()); |
| 147 | } | 147 | } |
| 148 | } | 148 | } |
| 149 | 149 | ||
| @@ -190,6 +190,6 @@ void ConsoleScriptingInterface::logGroupMessage(QString message, ScriptEngine* e · 40 unmodified lines | |||
| 190 | } | 190 | } |
| 191 | logMessage.append(message); | 191 | logMessage.append(message); |
| 192 | if (ScriptManager* scriptManager = engine->manager()) { | 192 | if (ScriptManager* scriptManager = engine->manager()) { |
| 193 | scriptManager->scriptPrintedMessage(logMessage); | 193 | scriptManager->scriptPrintedMessage(logMessage, context()->currentFileName(), context()->currentLineNumber()); |
| 194 | } | 194 | } |
| 195 | } | 195 | } |