aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/parser/qqmljsast_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-03-21 11:23:43 +0100
committerLars Knoll <lars.knoll@qt.io>2018-04-27 08:10:51 +0000
commit0de2ac924a3dbbd59b9e726f470113e4c87b0ae7 (patch)
tree9f2b9d8e83c303498cb6b879102a0cb6512797b1 /src/qml/parser/qqmljsast_p.h
parent602073631e73f8be3933e9500cb81170b2f4c1c0 (diff)
smaller cleanup
The VariableDeclaration constructor shouldn't specify the scope of the declared variable. Change-Id: I1368cec7c5cb8535e169c0fc20d3be4e69368b47 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/parser/qqmljsast_p.h')
-rw-r--r--src/qml/parser/qqmljsast_p.h9
1 files changed, 5 insertions, 4 deletions
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