Before:
for (let { a, b } of x) {
}
After:
for (let {a, b} of x) {
}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262776
91177308-0d34-0410-b5e6-
96231b3b80d8
//
// We exclude + and - as they can be ObjC visibility modifiers.
ProbablyBracedList =
+ (Style.Language == FormatStyle::LK_JavaScript &&
+ NextTok->isOneOf(Keywords.kw_of, Keywords.kw_in)) ||
NextTok->isOneOf(tok::comma, tok::period, tok::colon,
tok::r_paren, tok::r_square, tok::l_brace,
tok::l_square, tok::l_paren, tok::ellipsis) ||
"}");
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) {