aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-03-17 20:42:46 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-03-17 20:42:46 +0100
commit9477ba4e423276fe70e507ddbcc6e087def9f0ef (patch)
tree93034da8c847f030916d53d6fecbff21e4699457 /src/plugins
parent48e2b2e6eb37f06c93c77bde89e8ae0610038a6f (diff)
parent61447075954aab99b3abc9c78294e5966ae3b6ce (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp10
-rw-r--r--src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp10
2 files changed, 16 insertions, 4 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
index 5b049ab521..7950d21612 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
@@ -112,8 +112,14 @@ void JavaScriptJob::run()
script.inheritContext = true;
script.parse();
QV4::ScopedValue result(scope);
- if (!scope.engine->hasException)
- result = script.run();
+ if (!scope.engine->hasException) {
+ if (frame) {
+ QV4::ScopedValue thisObject(scope, frame->thisObject());
+ result = script.run(thisObject);
+ } else {
+ result = script.run();
+ }
+ }
if (scope.engine->hasException) {
result = scope.engine->catchException();
resultIsException = true;
diff --git a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
index 718975275a..e17fe92983 100644
--- a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
@@ -260,8 +260,14 @@ QV4::ReturnedValue NativeDebugger::evaluateExpression(const QString &expression)
// That is a side-effect of inheritContext.
script.inheritContext = true;
script.parse();
- if (!m_engine->hasException)
- return script.run();
+ if (!m_engine->hasException) {
+ if (m_engine->currentStackFrame) {
+ QV4::ScopedValue thisObject(scope, m_engine->currentStackFrame->thisObject());
+ script.run(thisObject);
+ } else {
+ script.run();
+ }
+ }
m_runningJob = false;
return QV4::Encode::undefined();