diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-05-09 14:03:39 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-11 07:17:22 +0000 |
commit | e3b9726483cb7336aa54ae7d9455becbd148b2b6 (patch) | |
tree | ba056c898a9a694179104e1fd4f4f32d91a6dd86 /src/qml/parser/qqmljsast_p.h | |
parent | 541b8220cffbbae4b798ae8282d04ca145caccd1 (diff) |
Improve for-in and for-of support
Create a Block scope per iteration as defined in the ES spec. So
closures created inside the loop will remember the iteration variable
at that loop iteration.
Add support for destructuring of the left hand side expression or
declaration.
Change-Id: Id06ef94e2a4b93646827da4f6ce922eb436e5a31
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.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h index 83fcb6559c..9ed7ba79e5 100644 --- a/src/qml/parser/qqmljsast_p.h +++ b/src/qml/parser/qqmljsast_p.h @@ -1725,6 +1725,10 @@ public: SourceLocation lastSourceLocation() const override { return statement->lastSourceLocation(); } + PatternElement *declaration() const { + return AST::cast<PatternElement *>(lhs); + } + // attributes Node *lhs; ExpressionNode *expression; |