diff options
author | Daniel Jasper <djasper@google.com> | 2016-03-05 18:34:26 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2016-03-05 18:34:26 +0000 |
commit | acffeb8b633d6d81e63f1d12d35507c38423ffc8 (patch) | |
tree | b1c7bd9a7c1ecd536deb6e207d8b461d1674c6d6 /clang/unittests/Format/FormatTestJS.cpp | |
parent | ce608690e1098301df73eb25d57b570a30bdd610 (diff) | |
download | bcm5719-llvm-acffeb8b633d6d81e63f1d12d35507c38423ffc8.tar.gz bcm5719-llvm-acffeb8b633d6d81e63f1d12d35507c38423ffc8.zip |
clang-format: [JS] Support destructuring assignments in for loops.
Before:
for (let { a, b } of x) {
}
After:
for (let {a, b} of x) {
}
llvm-svn: 262776
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index 589a7e48da3..6af4a69257f 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -606,6 +606,10 @@ TEST_F(FormatTestJS, ForLoops) { "}"); verifyFormat("for (var i of [2, 3]) {\n" "}"); + verifyFormat("for (let {a, b} of x) {\n" + "}"); + verifyFormat("for (let {a, b} in x) {\n" + "}"); } TEST_F(FormatTestJS, AutomaticSemicolonInsertion) { |