diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-05-08 15:21:27 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-11 07:17:16 +0000 |
commit | a8766dcd8c3a046aab1453ec3d28436bb75c895c (patch) | |
tree | a3ec1dd79c8a1604e0009b25aa01a9050c15cbb5 /src/qml/compiler/qv4compilerscanfunctions.cpp | |
parent | 01a1ad296c2b8325476abd6d28c8cc2463c42eb6 (diff) | |
download | qtdeclarative-a8766dcd8c3a046aab1453ec3d28436bb75c895c.tar.gz |
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 <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compilerscanfunctions.cpp')
-rw-r--r-- | src/qml/compiler/qv4compilerscanfunctions.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
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); |