aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp11
-rw-r--r--src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp5
2 files changed, 11 insertions, 5 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
index e852f574a7..8b51574525 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
@@ -67,11 +67,11 @@ void JavaScriptJob::run()
QV4::ScopedContext ctx(scope, engine->currentContext());
QObject scopeObject;
+ QV4::CppStackFrame *frame = engine->currentStackFrame;
if (frameNr > 0) {
- QV4::CppStackFrame *f = engine->currentStackFrame;
for (int i = 0; i < frameNr; ++i)
- f = f->parent;
- ctx = static_cast<QV4::ExecutionContext *>(&f->jsFrame->context);
+ frame = frame->parent;
+ ctx = static_cast<QV4::ExecutionContext *>(&frame->jsFrame->context);
}
if (context >= 0) {
@@ -103,7 +103,10 @@ void JavaScriptJob::run()
}
QV4::Script script(ctx, QV4::Compiler::EvalCode, this->script);
- script.strictMode = ctx->d()->v4Function->isStrict();
+ if (QV4::Function *function = frame->v4Function)
+ script.strictMode = function->isStrict();
+ else if (engine->globalCode)
+ script.strictMode = engine->globalCode->isStrict();
// In order for property lookups in QML to work, we need to disable fast v4 lookups. That
// is a side-effect of inheritContext.
script.inheritContext = true;
diff --git a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
index 7bf419a1d9..e8570a380f 100644
--- a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
@@ -252,7 +252,10 @@ QV4::ReturnedValue NativeDebugger::evaluateExpression(const QString &expression)
QV4::ExecutionContext *ctx = m_engine->currentContext();
QV4::Script script(ctx, QV4::Compiler::EvalCode, expression);
- script.strictMode = ctx->d()->v4Function->isStrict();
+ if (QV4::Function *function = m_engine->currentStackFrame->v4Function)
+ script.strictMode = function->isStrict();
+ else if (m_engine->globalCode)
+ script.strictMode = m_engine->globalCode->isStrict();
// In order for property lookups in QML to work, we need to disable fast v4 lookups.
// That is a side-effect of inheritContext.
script.inheritContext = true;