From 0de2ac924a3dbbd59b9e726f470113e4c87b0ae7 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 21 Mar 2018 11:23:43 +0100 Subject: smaller cleanup The VariableDeclaration constructor shouldn't specify the scope of the declared variable. Change-Id: I1368cec7c5cb8535e169c0fc20d3be4e69368b47 Reviewed-by: Simon Hausmann --- src/qml/parser/qqmljsast_p.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/qml/parser/qqmljsast_p.h') diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h index 8e25924a8d..21e27de5ac 100644 --- a/src/qml/parser/qqmljsast_p.h +++ b/src/qml/parser/qqmljsast_p.h @@ -1400,14 +1400,15 @@ public: QQMLJS_DECLARE_AST_NODE(VariableDeclaration) enum VariableScope { + UnknownScope, FunctionScope, BlockScope, // let ReadOnlyBlockScope // const }; - VariableDeclaration(const QStringRef &n, ExpressionNode *e, VariableScope s): - name (n), expression (e), scope(s) - { kind = K; } + VariableDeclaration(const QStringRef &n, ExpressionNode *e) + : name(n), expression(e) + { kind = K; } bool isLexicallyScoped() const { return scope != FunctionScope; } @@ -1423,7 +1424,7 @@ public: QStringRef name; ExpressionNode *expression; SourceLocation identifierToken; - VariableScope scope; + VariableScope scope = UnknownScope; }; class QML_PARSER_EXPORT VariableDeclarationList: public Node -- cgit v1.2.3