clang-format: [JS] JavaScript does not have the */&/&& madness.
Before:
e&& e.SomeFunction();
After:
e && e.SomeFunction();
Yeah, this might be useful for C++, too, but it is not such a frequent
pattern there (plus the fix is much harder).
llvm-svn: 217237
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index a4bd84a..bd931aa 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -83,6 +83,10 @@
verifyFormat("var b = a.map((x) => x + 1);");
}
+TEST_F(FormatTestJS, UnderstandsAmpAmp) {
+ verifyFormat("e && e.SomeFunction();");
+}
+
TEST_F(FormatTestJS, LiteralOperatorsCanBeKeywords) {
verifyFormat("not.and.or.not_eq = 1;");
}