History

changes from code review suggestions

Heather Anderson committed 5 years ago

Commit bd045541 parent 70fbe7611 files · +38 −42Browse files

Showing the changes to libraries/script-engine/src/qtscript/ScriptEngineQtScript.cpp (1 of 11 files). Show all

Unified · Split

libraries/script-engine/src/qtscript/ScriptEngineQtScript.cpp+11−11
@@ -229,11 +229,11 @@ bool ScriptEngineQtScript::raiseException(const QScriptValue& exception) { · 228 unmodified lines
229229 // we have an active context / JS stack frame so throw the exception per usual
230230 QScriptEngine::currentContext()->throwValue(makeError(exception));
231231 return true;
232− } else if(_manager) {
232+ } else if (_scriptManager) {
233233 // we are within a pure C++ stack frame (ie: being called directly by other C++ code)
234234 // in this case no context information is available so just emit the exception for reporting
235235 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))));
237237 }
238238 return false;
239239 }
@@ -242,8 +242,8 @@ bool ScriptEngineQtScript::maybeEmitUncaughtException(const QString& debugHint) · 2 unmodified lines
242242 if (!IS_THREADSAFE_INVOCATION(thread(), __FUNCTION__)) {
243243 return false;
244244 }
245− if (!isEvaluating() && hasUncaughtException() && _manager) {
246− emit _manager->unhandledException(cloneUncaughtException(debugHint));
245+ if (!isEvaluating() && hasUncaughtException() && _scriptManager) {
246+ emit _scriptManager->unhandledException(cloneUncaughtException(debugHint));
247247 clearExceptions();
248248 return true;
249249 }
@@ -322,21 +322,21 @@ static void ScriptValueFromQScriptValue(const QScriptValue& src, ScriptValue& de · 72 unmodified lines
322322
323323 ScriptEngineQtScript::ScriptEngineQtScript(ScriptManager* scriptManager) :
324324 QScriptEngine(),
325− _manager(scriptManager),
325+ _scriptManager(scriptManager),
326326 _arrayBufferClass(new ArrayBufferClass(this))
327327 {
328328 qScriptRegisterMetaType(this, ScriptValueToQScriptValue, ScriptValueFromQScriptValue);
329329
330− if (_manager) {
330+ if (_scriptManager) {
331331 connect(this, &QScriptEngine::signalHandlerException, this, [this](const QScriptValue& exception) {
332332 if (hasUncaughtException()) {
333333 // the engine's uncaughtException() seems to produce much better stack traces here
334− emit _manager->unhandledException(cloneUncaughtException("signalHandlerException"));
334+ emit _scriptManager->unhandledException(cloneUncaughtException("signalHandlerException"));
335335 clearExceptions();
336336 } else {
337337 // ... but may not always be available -- so if needed we fallback to the passed exception
338338 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))));
340340 }
341341 }, Qt::DirectConnection);
342342 moveToThread(scriptManager->thread());
@@ -649,7 +649,7 @@ ScriptValue ScriptEngineQtScript::evaluateInClosure(const ScriptValue& _closure, · 306 unmodified lines
649649 }
650650
651651 ScriptValue ScriptEngineQtScript::evaluate(const QString& sourceCode, const QString& fileName) {
652− if (_manager && _manager->isStopped()) {
652+ if (_scriptManager && _scriptManager->isStopped()) {
653653 return undefinedValue(); // bail early
654654 }
655655
@@ -692,7 +692,7 @@ ScriptValue ScriptEngineQtScript::evaluate(const QString& sourceCode, const QStr · 36 unmodified lines
692692 }
693693
694694 Q_INVOKABLE ScriptValue ScriptEngineQtScript::evaluate(const ScriptProgramPointer& program) {
695− if (_manager && _manager->isStopped()) {
695+ if (_scriptManager && _scriptManager->isStopped()) {
696696 return undefinedValue(); // bail early
697697 }
698698
@@ -751,7 +751,7 @@ ScriptValue ScriptEngineQtScript::globalObject() const { · 52 unmodified lines
751751 }
752752
753753 ScriptManager* ScriptEngineQtScript::manager() const {
754− return _manager;
754+ return _scriptManager;
755755 }
756756
757757 ScriptValue ScriptEngineQtScript::newArray(uint length) {