diff options
author | Daniel Jasper <djasper@google.com> | 2014-09-04 14:58:30 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-09-04 14:58:30 +0000 |
commit | 94e11d02d88ea33c3212d3dab3dc0245509c8fe5 (patch) | |
tree | b41bc26c86f7ac34aef529a9145f90ec5d255fb8 /clang/unittests/Format | |
parent | 2132b704ff72ba0f55793a2faea8323900cb619a (diff) | |
download | bcm5719-llvm-94e11d02d88ea33c3212d3dab3dc0245509c8fe5.tar.gz bcm5719-llvm-94e11d02d88ea33c3212d3dab3dc0245509c8fe5.zip |
clang-format: [JS] Support comments in dict literals.
Before:
var stuff = {
// comment for update
update : false,
// comment for update
modules : false,
// comment for update
tasks : false
};
After:
var stuff = {
// comment for update
update : false,
// comment for update
modules : false,
// comment for update
tasks : false
};
llvm-svn: 217157
Diffstat (limited to 'clang/unittests/Format')
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index f8802b85d60..4b0d1e77bd7 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -111,6 +111,14 @@ TEST_F(FormatTestJS, ContainerLiterals) { " f(); //\n" " }\n" "};"); + verifyFormat("var stuff = {\n" + " // comment for update\n" + " update: false,\n" + " // comment for modules\n" + " modules: false,\n" + " // comment for tasks\n" + " tasks: false\n" + "};"); } TEST_F(FormatTestJS, SpacesInContainerLiterals) { |