diff options
author | Daniel Jasper <djasper@google.com> | 2014-09-04 18:23:42 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-09-04 18:23:42 +0000 |
commit | 4db69bd5422e3a51e1843652682f7f753baf3c7d (patch) | |
tree | 83bac1026e7ce230fbcb5f147ba069366e334454 /clang/unittests/Format/FormatTestJS.cpp | |
parent | 6b3a94065b9f8c5c8e711af39b728d0746274dc9 (diff) | |
download | bcm5719-llvm-4db69bd5422e3a51e1843652682f7f753baf3c7d.tar.gz bcm5719-llvm-4db69bd5422e3a51e1843652682f7f753baf3c7d.zip |
clang-format: [JS] Support alternative operator names as identifiers.
Before:
not. and . or . not_eq = 1;
After:
not.and.or.not_eq = 1;
llvm-svn: 217179
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 5bb1a3850c8..fcddba72a8b 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, LiteralOperatorsCanBeKeywords) { + verifyFormat("not.and.or.not_eq = 1;"); +} + TEST_F(FormatTestJS, ES6DestructuringAssignment) { verifyFormat("var [a, b, c] = [1, 2, 3];"); verifyFormat("var {a, b} = {a: 1, b: 2};"); |