Showing the changes to libraries/script-engine/src/qtscript/ScriptEngineQtScript.cpp (1 of 11 files). Show all
Unified · Split
| @@ -229,11 +229,11 @@ bool ScriptEngineQtScript::raiseException(const QScriptValue& exception) { · 228 unmodified lines | ||
| 229 | 229 | // we have an active context / JS stack frame so throw the exception per usual |
| 230 | 230 | QScriptEngine::currentContext()->throwValue(makeError(exception)); |
| 231 | 231 | return true; |
| 232 | − } else if(_manager) { | |
| 232 | + } else if (_scriptManager) { | |
| 233 | 233 | // we are within a pure C++ stack frame (ie: being called directly by other C++ code) |
| 234 | 234 | // in this case no context information is available so just emit the exception for reporting |
| 235 | 235 | QScriptValue thrown = makeError(exception); |
| 236 | − emit _manager->unhandledException(ScriptValue(new ScriptValueQtWrapper(this, std::move(thrown)))); | |
| 236 | + emit _scriptManager->unhandledException(ScriptValue(new ScriptValueQtWrapper(this, std::move(thrown)))); | |
| 237 | 237 | } |
| 238 | 238 | return false; |
| 239 | 239 | } |
| @@ -242,8 +242,8 @@ bool ScriptEngineQtScript::maybeEmitUncaughtException(const QString& debugHint) · 2 unmodified lines | ||
| 242 | 242 | if (!IS_THREADSAFE_INVOCATION(thread(), __FUNCTION__)) { |
| 243 | 243 | return false; |
| 244 | 244 | } |
| 245 | − if (!isEvaluating() && hasUncaughtException() && _manager) { | |
| 246 | − emit _manager->unhandledException(cloneUncaughtException(debugHint)); | |
| 245 | + if (!isEvaluating() && hasUncaughtException() && _scriptManager) { | |
| 246 | + emit _scriptManager->unhandledException(cloneUncaughtException(debugHint)); | |
| 247 | 247 | clearExceptions(); |
| 248 | 248 | return true; |
| 249 | 249 | } |
| @@ -322,21 +322,21 @@ static void ScriptValueFromQScriptValue(const QScriptValue& src, ScriptValue& de · 72 unmodified lines | ||
| 322 | 322 | |
| 323 | 323 | ScriptEngineQtScript::ScriptEngineQtScript(ScriptManager* scriptManager) : |
| 324 | 324 | QScriptEngine(), |
| 325 | − _manager(scriptManager), | |
| 325 | + _scriptManager(scriptManager), | |
| 326 | 326 | _arrayBufferClass(new ArrayBufferClass(this)) |
| 327 | 327 | { |
| 328 | 328 | qScriptRegisterMetaType(this, ScriptValueToQScriptValue, ScriptValueFromQScriptValue); |
| 329 | 329 | |
| 330 | − if (_manager) { | |
| 330 | + if (_scriptManager) { | |
| 331 | 331 | connect(this, &QScriptEngine::signalHandlerException, this, [this](const QScriptValue& exception) { |
| 332 | 332 | if (hasUncaughtException()) { |
| 333 | 333 | // the engine's uncaughtException() seems to produce much better stack traces here |
| 334 | − emit _manager->unhandledException(cloneUncaughtException("signalHandlerException")); | |
| 334 | + emit _scriptManager->unhandledException(cloneUncaughtException("signalHandlerException")); | |
| 335 | 335 | clearExceptions(); |
| 336 | 336 | } else { |
| 337 | 337 | // ... but may not always be available -- so if needed we fallback to the passed exception |
| 338 | 338 | QScriptValue thrown = makeError(exception); |
| 339 | − emit _manager->unhandledException(ScriptValue(new ScriptValueQtWrapper(this, std::move(thrown)))); | |
| 339 | + emit _scriptManager->unhandledException(ScriptValue(new ScriptValueQtWrapper(this, std::move(thrown)))); | |
| 340 | 340 | } |
| 341 | 341 | }, Qt::DirectConnection); |
| 342 | 342 | moveToThread(scriptManager->thread()); |
| @@ -649,7 +649,7 @@ ScriptValue ScriptEngineQtScript::evaluateInClosure(const ScriptValue& _closure, · 306 unmodified lines | ||
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | ScriptValue ScriptEngineQtScript::evaluate(const QString& sourceCode, const QString& fileName) { |
| 652 | − if (_manager && _manager->isStopped()) { | |
| 652 | + if (_scriptManager && _scriptManager->isStopped()) { | |
| 653 | 653 | return undefinedValue(); // bail early |
| 654 | 654 | } |
| 655 | 655 | |
| @@ -692,7 +692,7 @@ ScriptValue ScriptEngineQtScript::evaluate(const QString& sourceCode, const QStr · 36 unmodified lines | ||
| 692 | 692 | } |
| 693 | 693 | |
| 694 | 694 | Q_INVOKABLE ScriptValue ScriptEngineQtScript::evaluate(const ScriptProgramPointer& program) { |
| 695 | − if (_manager && _manager->isStopped()) { | |
| 695 | + if (_scriptManager && _scriptManager->isStopped()) { | |
| 696 | 696 | return undefinedValue(); // bail early |
| 697 | 697 | } |
| 698 | 698 | |
| @@ -751,7 +751,7 @@ ScriptValue ScriptEngineQtScript::globalObject() const { · 52 unmodified lines | ||
| 751 | 751 | } |
| 752 | 752 | |
| 753 | 753 | ScriptManager* ScriptEngineQtScript::manager() const { |
| 754 | − return _manager; | |
| 754 | + return _scriptManager; | |
| 755 | 755 | } |
| 756 | 756 | |
| 757 | 757 | ScriptValue ScriptEngineQtScript::newArray(uint length) { |