From 20d30b6b3a253eebedc927dbb91685bbec52cfee Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 26 Mar 2018 22:59:28 +0200 Subject: Add support for proper lexical scoping This is still to some extend work in progress as lexically scoped for loops won't yet do the right thing. let and const variables are still accessible before they are declared, and the global scope doesn't yet have a proper context for lexically declared variables. Change-Id: Ie39f74a8fccdaead437fbf07f9fc228a444c26ed Reviewed-by: Simon Hausmann --- tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'tests/auto/qml/debugger/qv4debugger') diff --git a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp index 17a99d6a43..ccb3a2dcdc 100644 --- a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp +++ b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp @@ -220,7 +220,21 @@ public: { for (int i = 0, ei = m_stackTrace.size(); i != ei; ++i) { m_capturedScope.append(NamedRefs()); - ScopeJob job(&collector, i, 0); + FrameJob frameJob(&collector, i); + debugger->runInEngine(&frameJob); + QJsonObject frameObj = frameJob.returnValue(); + QJsonArray scopes = frameObj.value(QLatin1String("scopes")).toArray(); + int nscopes = scopes.size(); + int s = 0; + for (s = 0; s < nscopes; ++s) { + QJsonObject o = scopes.at(s).toObject(); + if (o.value(QLatin1String("type")).toInt(-2) == 1) // CallContext + break; + } + if (s == nscopes) + return; + + ScopeJob job(&collector, i, s); debugger->runInEngine(&job); NamedRefs &refs = m_capturedScope.last(); QJsonObject object = job.returnValue(); -- cgit v1.2.3