From: Daniel Jasper Date: Fri, 12 Jun 2015 04:56:34 +0000 (+0000) Subject: clang-format: [JS] Fix regression caused by r239592. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7fd025f21c2ffa1c951434abdd8273078be285a1;p=clang clang-format: [JS] Fix regression caused by r239592. Without it, it would do: interface I { x: string; } var y; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239593 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp index 7f5df7dfba..2762979b6b 100644 --- a/lib/Format/UnwrappedLineParser.cpp +++ b/lib/Format/UnwrappedLineParser.cpp @@ -854,6 +854,7 @@ void UnwrappedLineParser::parseStructuralElement() { Style.Language == FormatStyle::LK_Java) && FormatTok->is(Keywords.kw_interface)) { parseRecord(); + addUnwrappedLine(); break; } diff --git a/unittests/Format/FormatTestJS.cpp b/unittests/Format/FormatTestJS.cpp index e01637bfad..0f9f38240a 100644 --- a/unittests/Format/FormatTestJS.cpp +++ b/unittests/Format/FormatTestJS.cpp @@ -665,7 +665,8 @@ TEST_F(FormatTestJS, ClassDeclarations) { TEST_F(FormatTestJS, InterfaceDeclarations) { verifyFormat("interface I {\n" " x: string;\n" - "}"); + "}\n" + "var y;"); } TEST_F(FormatTestJS, MetadataAnnotations) {