clang-format: [JS] Don't count shortened object literals as blocks.
Before:
f({a},
() => {
g(); //
});
After:
f({a}, () => {
g(); //
});
llvm-svn: 260060
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 7f25d59..7fad83a 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -200,6 +200,11 @@
" b: 2,\n"
" [c]: 3,\n"
"};");
+
+ // Object literals can leave out labels.
+ verifyFormat("f({a}, () => {\n"
+ " g(); //\n"
+ "});");
}
TEST_F(FormatTestJS, MethodsInObjectLiterals) {