diff options
author | Daniel Jasper <djasper@google.com> | 2014-09-05 09:27:38 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-09-05 09:27:38 +0000 |
commit | 90ebc98e3da2024c5a7979cf61dae3ec6c1df550 (patch) | |
tree | f16769e52a8f2dac12b0b0be19e1bd496058f470 /clang/unittests/Format/FormatTestJS.cpp | |
parent | 3a038de3c8f3b898d49df0c1988eecfea9cfdca8 (diff) | |
download | bcm5719-llvm-90ebc98e3da2024c5a7979cf61dae3ec6c1df550.tar.gz bcm5719-llvm-90ebc98e3da2024c5a7979cf61dae3ec6c1df550.zip |
clang-format: [JS] Format embedded function literals more efficently.
Before:
return {
a: a,
link:
function() {
f(); //
},
link:
function() {
f(); //
}
};
After:
return {
a: a,
link: function() {
f(); //
},
link: function() {
f(); //
}
};
llvm-svn: 217238
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index bd931aaf0a3..b161699d943 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -110,14 +110,12 @@ TEST_F(FormatTestJS, ContainerLiterals) { "};"); verifyFormat("return {\n" " a: a,\n" - " link:\n" - " function() {\n" - " f(); //\n" - " },\n" - " link:\n" - " function() {\n" - " f(); //\n" - " }\n" + " link: function() {\n" + " f(); //\n" + " },\n" + " link: function() {\n" + " f(); //\n" + " }\n" "};"); verifyFormat("var stuff = {\n" " // comment for update\n" |