From 259188b1b58e9441d0aff11537a589b61ce611ed Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Fri, 12 Jun 2015 04:56:34 +0000 Subject: [PATCH] clang-format: [JS] Fix regression caused by r239592. Without it, it would do: interface I { x: string; } var y; llvm-svn: 239593 --- clang/lib/Format/UnwrappedLineParser.cpp | 1 + clang/unittests/Format/FormatTestJS.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 7f5df7d..2762979 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/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/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index e01637b..0f9f382 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/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) { -- 2.7.4