aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/compiler/qv4compilercontext.cpp1
-rw-r--r--src/qml/compiler/qv4compilerscanfunctions.cpp6
2 files changed, 6 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4compilercontext.cpp b/src/qml/compiler/qv4compilercontext.cpp
index a0467aa427..d232a43291 100644
--- a/src/qml/compiler/qv4compilercontext.cpp
+++ b/src/qml/compiler/qv4compilercontext.cpp
@@ -132,7 +132,6 @@ Context::ResolvedName Context::resolveName(const QString &name)
result.type = ResolvedName::Local;
return result;
} else {
- Q_ASSERT(scope == 0);
result.index = argIdx + sizeof(CallData)/sizeof(Value) - 1;
result.scope = 0;
result.type = ResolvedName::Stack;
diff --git a/src/qml/compiler/qv4compilerscanfunctions.cpp b/src/qml/compiler/qv4compilerscanfunctions.cpp
index f5bfd14c93..40459b3b28 100644
--- a/src/qml/compiler/qv4compilerscanfunctions.cpp
+++ b/src/qml/compiler/qv4compilerscanfunctions.cpp
@@ -524,6 +524,12 @@ void ScanFunctions::calcEscapingVariables()
for (const QString &var : qAsConst(inner->usedVariables)) {
Context *c = inner;
while (c) {
+ Context *current = c;
+ c = c->parent;
+ if (current->isWithBlock || current->contextType != ContextType::Block)
+ break;
+ }
+ while (c) {
Context::MemberMap::const_iterator it = c->members.find(var);
if (it != c->members.end()) {
if (c != inner) {