diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-03 20:26:28 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-08-04 07:08:19 +0000 |
commit | c0f961cd6b82a523e277f6d8778a20508b15697d (patch) | |
tree | 7e4986686630404123a9f40eeb4881a089072d12 /src/plugins/qmltooling | |
parent | b46b2e28b39443f6250c0d751a593b35af1c8c1e (diff) |
Change function signatures for call/construct back
Change those back again to return a value. This will be required
to avoid creation of Scope objects between JS function calls.
Change-Id: I05cb5cf8fd0c13dcefa60d213ccd5983fab57ea3
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/plugins/qmltooling')
-rw-r--r-- | src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp index 13425b36c2..59d4687615 100644 --- a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp +++ b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp @@ -207,7 +207,7 @@ private: void handleDebuggerDeleted(QObject *debugger); - void evaluateExpression(QV4::Scope &scope, const QString &expression); + QV4::ReturnedValue evaluateExpression(const QString &expression); bool checkCondition(const QString &expression); QStringList breakOnSignals; @@ -239,13 +239,12 @@ private: bool NativeDebugger::checkCondition(const QString &expression) { - QV4::Scope scope(m_engine); - evaluateExpression(scope, expression); - return scope.result.booleanValue(); + return evaluateExpression(expression).booleanValue(); } -void NativeDebugger::evaluateExpression(QV4::Scope &scope, const QString &expression) +QV4::ReturnedValue NativeDebugger::evaluateExpression(const QString &expression) { + QV4::Scope scope(m_engine); m_runningJob = true; QV4::ExecutionContextSaver saver(scope); @@ -260,9 +259,10 @@ void NativeDebugger::evaluateExpression(QV4::Scope &scope, const QString &expres script.inheritContext = true; script.parse(); if (!m_engine->hasException) - scope.result = script.run(); + return script.run(); m_runningJob = false; + return QV4::Encode::undefined(); } NativeDebugger::NativeDebugger(QQmlNativeDebugServiceImpl *service, QV4::ExecutionEngine *engine) @@ -542,8 +542,7 @@ void NativeDebugger::handleExpressions(QJsonObject *response, const QJsonObject TRACE_PROTOCOL("Evaluate expression: " << expression); m_runningJob = true; - evaluateExpression(scope, expression); - QV4::ScopedValue result(scope, scope.result); + QV4::ScopedValue result(scope, evaluateExpression(expression)); m_runningJob = false; if (result->isUndefined()) { |