diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-04-06 11:33:20 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-02 14:17:55 +0000 |
commit | 2c23299ecd94dbcce0a90b3b374a674cad6a3683 (patch) | |
tree | a5ade5f3b39685ada7d069b89b86e8b983ee159a /src/qml/compiler/qv4compilerscanfunctions_p.h | |
parent | 922e6f42b4fa9b9fa87246c577c13bb945bd4bc4 (diff) |
Cleanup handling of with() statements
Add a CompilerContext for with, whose only purpose it
is to trigger variable lookup by name. This avoids looking
up variables declared inside the with() {} block by name and
we do not lookup variables outside the with block by name
neither anymore.
Change-Id: I52e9fb2daa9601f9e5102714c002dc506ad5ed23
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compilerscanfunctions_p.h')
-rw-r--r-- | src/qml/compiler/qv4compilerscanfunctions_p.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4compilerscanfunctions_p.h b/src/qml/compiler/qv4compilerscanfunctions_p.h index 013cb0d4e6..31e260b7ad 100644 --- a/src/qml/compiler/qv4compilerscanfunctions_p.h +++ b/src/qml/compiler/qv4compilerscanfunctions_p.h @@ -123,8 +123,6 @@ protected: bool visit(AST::FunctionDeclaration *ast) override; void endVisit(AST::FunctionDeclaration *) override; - bool visit(AST::WithStatement *ast) override; - bool visit(AST::DoWhileStatement *ast) override; bool visit(AST::ForStatement *ast) override; bool visit(AST::LocalForStatement *ast) override; @@ -138,6 +136,9 @@ protected: bool visit(AST::Catch *ast) override; void endVisit(AST::Catch *ast) override; + bool visit(AST::WithStatement *ast) override; + void endVisit(AST::WithStatement *ast) override; + protected: bool enterFunction(AST::Node *ast, const QString &name, AST::FormalParameterList *formals, AST::StatementList *body, bool enterName); |