From f144620cc19a51268199b2661e7097d9ab0448e4 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Thu, 2 Jul 2015 15:00:44 +0000 Subject: clang-format: [JS] Treat regex literals like string literals. Using the token type "unknown" can interfere badly with WhitespaceManager's way of handling multiline comments. llvm-svn: 241273 --- clang/unittests/Format/FormatTestJS.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/unittests/Format/FormatTestJS.cpp') diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index ef5901e8d69..b3e0f68ac3b 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -638,6 +638,10 @@ TEST_F(FormatTestJS, RegexLiteralSpecialCharacters) { getGoogleJSStyleWithColumns(15)); verifyFormat("var regex = //\n" " /a/;"); + verifyFormat("var regexs = [\n" + " /d/, //\n" + " /aa/, //\n" + "];"); } TEST_F(FormatTestJS, RegexLiteralModifiers) { -- cgit v1.2.3