summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2017-03-01 19:47:28 +0000
committerDaniel Jasper <djasper@google.com>2017-03-01 19:47:28 +0000
commit893b8adca2b7bbd25a0e6735cd4f20c3e8087b49 (patch)
tree01b89f7dc483f5f8d5ae660831258c9afdccb563 /clang/unittests/Format/FormatTestJS.cpp
parent8932d6489194af95714c8d08c44503465c85d2c2 (diff)
downloadbcm5719-llvm-893b8adca2b7bbd25a0e6735cd4f20c3e8087b49.tar.gz
bcm5719-llvm-893b8adca2b7bbd25a0e6735cd4f20c3e8087b49.zip
clang-format: [JS] Properly format object literals with shorthands.
Before: return { a, b: 'b', c, }; After: return { a, b: 'b', c, }; llvm-svn: 296664
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 88f081326d7..f45ec7356b3 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -278,6 +278,11 @@ TEST_F(FormatTestJS, ContainerLiterals) {
" aaa,\n"
" aaa,\n"
"};");
+ verifyFormat("return {\n"
+ " a,\n"
+ " b: 'b',\n"
+ " c,\n"
+ "};");
}
TEST_F(FormatTestJS, MethodsInObjectLiterals) {
OpenPOWER on IntegriCloud