summaryrefslogtreecommitdiff
path: root/src/qml/compiler/qv4compilerscanfunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/compiler/qv4compilerscanfunctions.cpp')
-rw-r--r--src/qml/compiler/qv4compilerscanfunctions.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compilerscanfunctions.cpp b/src/qml/compiler/qv4compilerscanfunctions.cpp
index eadbc3ae17..ccf7e49e25 100644
--- a/src/qml/compiler/qv4compilerscanfunctions.cpp
+++ b/src/qml/compiler/qv4compilerscanfunctions.cpp
@@ -342,6 +342,8 @@ bool ScanFunctions::visit(LocalForStatement *ast) {
}
bool ScanFunctions::visit(ForEachStatement *ast) {
+ enterEnvironment(ast, ContextType::Block);
+ _context->name = QLatin1String("Foreach");
Node::accept(ast->lhs, this);
Node::accept(ast->expression, this);
@@ -351,6 +353,11 @@ bool ScanFunctions::visit(ForEachStatement *ast) {
return false;
}
+void ScanFunctions::endVisit(ForEachStatement *)
+{
+ leaveEnvironment();
+}
+
bool ScanFunctions::visit(ThisExpression *)
{
_context->usesThis = true;