diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-02-26 10:08:37 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-04-25 17:49:44 +0000 |
commit | aabf2196016d96bd171a7d632b6e1cc5622d05ae (patch) | |
tree | 6e30bcc5bb6b6fbaa30d31b296e254ad0048e5a3 /src/qml/parser/qqmljsast.cpp | |
parent | da5fffbd34d8be68f8ee4c649881dbb673c9c0a5 (diff) |
Support for destructuring arrays
add support for destructuring of arrays when passing
arguments to functions.
Change-Id: I19feb39aa3ae520ec7591d49d1b14ceaa78783c6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/parser/qqmljsast.cpp')
-rw-r--r-- | src/qml/parser/qqmljsast.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/qml/parser/qqmljsast.cpp b/src/qml/parser/qqmljsast.cpp index 60064319c9..8b253abbef 100644 --- a/src/qml/parser/qqmljsast.cpp +++ b/src/qml/parser/qqmljsast.cpp @@ -1093,9 +1093,12 @@ void BindingElementList::accept0(Visitor *visitor) void BindingElementList::boundNames(QStringList *names) { - // ### - Q_UNUSED(names); - + for (BindingElementList *it = this; it; it = it->next) { + if (BindingElement *e = it->bindingElement()) + e->boundNames(names); + else if (BindingRestElement *r = it->bindingRestElement()) + names->append(r->name.toString()); + } } void BindingPropertyList::accept0(Visitor *visitor) |