From acffeb8b633d6d81e63f1d12d35507c38423ffc8 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Sat, 5 Mar 2016 18:34:26 +0000 Subject: 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 --- clang/unittests/Format/FormatTestJS.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/unittests/Format/FormatTestJS.cpp') 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) { -- cgit v1.2.3