summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2016-01-08 07:06:07 +0000
committerDaniel Jasper <djasper@google.com>2016-01-08 07:06:07 +0000
commitd5ec65ba338493c3a615219cf8b2ad3fb75b5377 (patch)
tree07005ec8db6430995516926ae04f28a52f2526b7 /clang/unittests/Format/FormatTestJS.cpp
parent872df22caae37546e0c05fc2529c661aab618f12 (diff)
downloadbcm5719-llvm-d5ec65ba338493c3a615219cf8b2ad3fb75b5377.tar.gz
bcm5719-llvm-d5ec65ba338493c3a615219cf8b2ad3fb75b5377.zip
clang-format: [JS] Support more ES6 classes.
Before: foo = class { constructor() {} } ; After: foo = class { constructor() {} }; llvm-svn: 257154
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 2f1ba5bc146..cbfa2a33205 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -755,6 +755,12 @@ TEST_F(FormatTestJS, ClassDeclarations) {
" aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaa: aaaaaaaaaaaaaaaaaaaa):\n"
" aaaaaaaaaaaaaaaaaaaaaa {}\n"
"}");
+ verifyFormat("foo = class Name {\n"
+ " constructor() {}\n"
+ "};");
+ verifyFormat("foo = class {\n"
+ " constructor() {}\n"
+ "};");
// ':' is not a type declaration here.
verifyFormat("class X {\n"
OpenPOWER on IntegriCloud