diff options
| author | Daniel Jasper <djasper@google.com> | 2017-01-30 07:08:40 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2017-01-30 07:08:40 +0000 |
| commit | 51c868e9aaf9ece6b1986e64e5a525253ba12e5b (patch) | |
| tree | 645415fc9d2bcd9b614aca7d8c305dd1d98bcbd0 /clang/unittests/Format/FormatTestJS.cpp | |
| parent | f6df4a6978bd12d40bf5e484d840128666dadede (diff) | |
| download | bcm5719-llvm-51c868e9aaf9ece6b1986e64e5a525253ba12e5b.tar.gz bcm5719-llvm-51c868e9aaf9ece6b1986e64e5a525253ba12e5b.zip | |
clang-format: [JavaScript] Undo r291974 for JavaScript.
This had significant negative consequences and I don't have a good
solution for it yet.
Before:
var string =
[
'aaaaaa',
'bbbbbb',
]
.join('+');
After:
var string = [
'aaaaaa',
'bbbbbb',
].join('+');
llvm-svn: 293465
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index 53800de9d23..8e33346d630 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -497,6 +497,11 @@ TEST_F(FormatTestJS, ArrayLiterals) { " [];"); verifyFormat("someFunction([], {a: a});"); + + verifyFormat("var string = [\n" + " 'aaaaaa',\n" + " 'bbbbbb',\n" + "].join('+');"); } TEST_F(FormatTestJS, ColumnLayoutForArrayLiterals) { @@ -587,6 +592,11 @@ TEST_F(FormatTestJS, FunctionLiterals) { " doSomething();\n" "}, this));"); + verifyFormat("SomeFunction(function() {\n" + " foo();\n" + " bar();\n" + "}.bind(this));"); + // FIXME: This is bad, we should be wrapping before "function() {". verifyFormat("someFunction(function() {\n" " doSomething(); // break\n" |

