diff options
author | Daniel Jasper <djasper@google.com> | 2016-02-07 22:17:13 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2016-02-07 22:17:13 +0000 |
commit | 9f4c9d418f549b45b654eb98cacc7c40cca8e522 (patch) | |
tree | 650c5c3f7ea6f983b3eca41478e623a0848f993c /clang/unittests/Format/FormatTestJS.cpp | |
parent | d64186f5dad36c419d95dc76130c74b76ca59892 (diff) | |
download | bcm5719-llvm-9f4c9d418f549b45b654eb98cacc7c40cca8e522.tar.gz bcm5719-llvm-9f4c9d418f549b45b654eb98cacc7c40cca8e522.zip |
clang-format: [JS] Don't count shortened object literals as blocks.
Before:
f({a},
() => {
g(); //
});
After:
f({a}, () => {
g(); //
});
llvm-svn: 260060
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index 7f25d5921b3..7fad83aab12 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -200,6 +200,11 @@ TEST_F(FormatTestJS, ContainerLiterals) { " b: 2,\n" " [c]: 3,\n" "};"); + + // Object literals can leave out labels. + verifyFormat("f({a}, () => {\n" + " g(); //\n" + "});"); } TEST_F(FormatTestJS, MethodsInObjectLiterals) { |