diff options
author | Daniel Jasper <djasper@google.com> | 2014-09-05 08:53:45 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-09-05 08:53:45 +0000 |
commit | 3a038de3c8f3b898d49df0c1988eecfea9cfdca8 (patch) | |
tree | 1cf1944208648a0fb2a6119a07a40c32f4e87735 /clang/unittests/Format/FormatTestJS.cpp | |
parent | 3f69ba107515e95a0f21affca5a5159b274d448a (diff) | |
download | bcm5719-llvm-3a038de3c8f3b898d49df0c1988eecfea9cfdca8.tar.gz bcm5719-llvm-3a038de3c8f3b898d49df0c1988eecfea9cfdca8.zip |
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
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index a4bd84a3242..bd931aaf0a3 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -83,6 +83,10 @@ TEST_F(FormatTestJS, UnderstandsJavaScriptOperators) { 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;"); } |