diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-05-10 22:55:55 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-11 07:17:29 +0000 |
commit | fd183d3db9d1eba4f7dd3e978192a247bf7dba85 (patch) | |
tree | c8359248c07cb4467e4c8b844a07a0d4ba8abaab /src/qml/compiler/qv4codegen.cpp | |
parent | e203a868470ab2e435111127f00530f4d8cc581d (diff) | |
download | qtdeclarative-fd183d3db9d1eba4f7dd3e978192a247bf7dba85.tar.gz |
Give for loops a proper block scope for it's lexically declared vars
Change-Id: I71c40d1d061ac3c1c623dbbf8f7967c9ec35c082
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index fc7ca911e8..687731c32b 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -2687,6 +2687,8 @@ bool Codegen::visit(ForStatement *ast) RegisterScope scope(this); + ControlFlowBlock controlFlow(this, ast); + if (ast->initialiser) statement(ast->initialiser); else if (ast->declarations) |