From a8766dcd8c3a046aab1453ec3d28436bb75c895c Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 8 May 2018 15:21:27 +0200 Subject: Unify ForeachStatement and LocalForeachStatement in the AST This saves quite some duplicated code, but requires a bit of care when iterating over the AST. Change-Id: Ic530de4be8b36b4079c9d544b4b77982c3b8be60 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4compilerscanfunctions.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/qml/compiler/qv4compilerscanfunctions.cpp') diff --git a/src/qml/compiler/qv4compilerscanfunctions.cpp b/src/qml/compiler/qv4compilerscanfunctions.cpp index 4dbd11ef1c..eadbc3ae17 100644 --- a/src/qml/compiler/qv4compilerscanfunctions.cpp +++ b/src/qml/compiler/qv4compilerscanfunctions.cpp @@ -342,17 +342,7 @@ bool ScanFunctions::visit(LocalForStatement *ast) { } bool ScanFunctions::visit(ForEachStatement *ast) { - Node::accept(ast->initialiser, this); - Node::accept(ast->expression, this); - - TemporaryBoolAssignment allowFuncDecls(_allowFuncDecls, !_context->isStrict); - Node::accept(ast->statement, this); - - return false; -} - -bool ScanFunctions::visit(LocalForEachStatement *ast) { - Node::accept(ast->declaration, this); + Node::accept(ast->lhs, this); Node::accept(ast->expression, this); TemporaryBoolAssignment allowFuncDecls(_allowFuncDecls, !_context->isStrict); -- cgit v1.2.3