aboutsummaryrefslogtreecommitdiffstats
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 31663e2162..c2256537c4 100644
--- a/src/qml/compiler/qv4compilerscanfunctions.cpp
+++ b/src/qml/compiler/qv4compilerscanfunctions.cpp
@@ -320,6 +320,8 @@ bool ScanFunctions::visit(DoWhileStatement *ast) {
}
bool ScanFunctions::visit(ForStatement *ast) {
+ enterEnvironment(ast, ContextType::Block);
+ _context->name = QLatin1String("For");
Node::accept(ast->initialiser, this);
Node::accept(ast->declarations, this);
Node::accept(ast->condition, this);
@@ -331,6 +333,11 @@ bool ScanFunctions::visit(ForStatement *ast) {
return false;
}
+void ScanFunctions::endVisit(ForStatement *)
+{
+ leaveEnvironment();
+}
+
bool ScanFunctions::visit(ForEachStatement *ast) {
enterEnvironment(ast, ContextType::Block);
_context->name = QLatin1String("Foreach");