diff options
Diffstat (limited to 'src/qml/compiler/qv4compilerscanfunctions.cpp')
-rw-r--r-- | src/qml/compiler/qv4compilerscanfunctions.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compilerscanfunctions.cpp b/src/qml/compiler/qv4compilerscanfunctions.cpp index 88fccc548d..9605b72b76 100644 --- a/src/qml/compiler/qv4compilerscanfunctions.cpp +++ b/src/qml/compiler/qv4compilerscanfunctions.cpp @@ -568,6 +568,17 @@ void ScanFunctions::calcEscapingVariables() c = c->parent; } } + if (inner->usesThis) { + inner->usesThis = false; + if (!inner->isStrict) { + Context *c = inner; + while (c->contextType == ContextType::Block) { + c = c->parent; + } + Q_ASSERT(c); + c->usesThis = true; + } + } } for (Context *c : qAsConst(m->contextMap)) { if (c->allVarsEscape && c->contextType == ContextType::Block && c->members.isEmpty()) |