clang-format: [JS] Support more regex literals.
Previously a regex-literal containing "/*" would through clang-format
off, e.g.:
var regex = /\/*$/;
Would lead to none of the following code to be formatted.
llvm-svn: 220860
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index bc9bbad..6ee150c 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -408,6 +408,10 @@
verifyFormat("var regex = /\a\\//g;");
verifyFormat("var regex = /a\\//;\n"
"var x = 0;");
+ EXPECT_EQ("var regex = /\\/*/;\n"
+ "var x = 0;",
+ format("var regex = /\\/*/;\n"
+ "var x=0;"));
}
TEST_F(FormatTestJS, RegexLiteralModifiers) {