diff options
author | Martin Probst <martin@probst.io> | 2016-06-09 22:49:04 +0000 |
---|---|---|
committer | Martin Probst <martin@probst.io> | 2016-06-09 22:49:04 +0000 |
commit | a6d5f7999c292d3bd922f11934d337b78ba4b194 (patch) | |
tree | c5c652384461e26b565882642eac3b34943d704f /unittests | |
parent | e20045069f0af7b5b524fa9d21c2ef9a21cfa93e (diff) |
clang-format: [JS] recognized named functions in AnnotatingParser.
Summary: This also fixes union type formatting in function parameter types.
Before: function x(path: number| string) {}
After: function x(path: number|string) {}
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D21206
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272330 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Format/FormatTestJS.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/unittests/Format/FormatTestJS.cpp b/unittests/Format/FormatTestJS.cpp index f646b82c21..3d9677922c 100644 --- a/unittests/Format/FormatTestJS.cpp +++ b/unittests/Format/FormatTestJS.cpp @@ -903,6 +903,8 @@ TEST_F(FormatTestJS, UnionIntersectionTypes) { verifyFormat("let x: Foo<A|B> = new Foo<A|B>();"); verifyFormat("function(x: A|B): C&D {}"); verifyFormat("function(x: A|B = A | B): C&D {}"); + verifyFormat("function x(path: number|string) {}"); + verifyFormat("function x(): string|number {}"); } TEST_F(FormatTestJS, ClassDeclarations) { |