From 2ec2324f3c70abd722eced1df41d7257143164ac Mon Sep 17 00:00:00 2001 From: Martin Probst Date: Thu, 9 Jun 2016 22:49:04 +0000 Subject: 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 llvm-svn: 272330 --- clang/unittests/Format/FormatTestJS.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/unittests/Format/FormatTestJS.cpp') diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index f646b82c213..3d9677922cf 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -903,6 +903,8 @@ TEST_F(FormatTestJS, UnionIntersectionTypes) { verifyFormat("let x: Foo = new Foo();"); 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) { -- cgit v1.2.3