summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2016-03-05 18:34:26 +0000
committerDaniel Jasper <djasper@google.com>2016-03-05 18:34:26 +0000
commitacffeb8b633d6d81e63f1d12d35507c38423ffc8 (patch)
treeb1c7bd9a7c1ecd536deb6e207d8b461d1674c6d6 /clang/unittests/Format/FormatTestJS.cpp
parentce608690e1098301df73eb25d57b570a30bdd610 (diff)
downloadbcm5719-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.cpp4
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) {
OpenPOWER on IntegriCloud