diff options
author | Daniel Jasper <djasper@google.com> | 2016-01-08 10:51:24 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2016-01-08 10:51:24 +0000 |
commit | f412e26d046cfe8666c5ce08b11a66ca44974abd (patch) | |
tree | 6ca007eb9a12564432a4b75973c65c70e74aa0ec /clang/unittests/Format/FormatTestJS.cpp | |
parent | bcd7fda849a6699a3c4856462911621dc2320647 (diff) | |
download | bcm5719-llvm-f412e26d046cfe8666c5ce08b11a66ca44974abd.tar.gz bcm5719-llvm-f412e26d046cfe8666c5ce08b11a66ca44974abd.zip |
clang-format: [JS] Prefer wrapping before the TypeScript return type
over wrapping before parameters.
Before:
function someFunc(
args: string[]): {longReturnValue: string[]} {}
After:
function someFunc(args: string[]):
{longReturnValue: string[]} {}
llvm-svn: 257162
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index 4600d7feb3d..7514c43ad43 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -740,6 +740,9 @@ TEST_F(FormatTestJS, TypeAnnotations) { verifyFormat("var x: P<string, (a: number) => string>;"); verifyFormat("var x = {y: function(): z { return 1; }};"); verifyFormat("var x = {y: function(): {a: number} { return 1; }};"); + verifyFormat("function someFunc(args: string[]):\n" + " {longReturnValue: string[]} {}", + getGoogleJSStyleWithColumns(60)); } TEST_F(FormatTestJS, ClassDeclarations) { |