summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorMartin Probst <martin@probst.io>2016-09-22 07:18:00 +0000
committerMartin Probst <martin@probst.io>2016-09-22 07:18:00 +0000
commit4210d2fd1eead974b86340a29c8c6012bbe22599 (patch)
tree7bc8efd40c506f12c5c711fef57d8466024563ef /clang/unittests/Format/FormatTestJS.cpp
parent5fbabd77c713dab61444ee1b527c2aa19c89b7cd (diff)
downloadbcm5719-llvm-4210d2fd1eead974b86340a29c8c6012bbe22599.tar.gz
bcm5719-llvm-4210d2fd1eead974b86340a29c8c6012bbe22599.zip
clang-format: [JS] reserved words in method names.
Summary: Before: class X { delete () { ... } } After: class X { delete() { ... } } Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D24804 llvm-svn: 282138
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index c19c054ec02..329613813c0 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -147,6 +147,21 @@ TEST_F(FormatTestJS, ReservedWords) {
verifyFormat("x = interface instanceof y;");
}
+TEST_F(FormatTestJS, ReservedWordsMethods) {
+ verifyFormat(
+ "class X {\n"
+ " delete() {\n"
+ " x();\n"
+ " }\n"
+ " interface() {\n"
+ " x();\n"
+ " }\n"
+ " let() {\n"
+ " x();\n"
+ " }\n"
+ "}\n");
+}
+
TEST_F(FormatTestJS, CppKeywords) {
// Make sure we don't mess stuff up because of C++ keywords.
verifyFormat("return operator && (aa);");
OpenPOWER on IntegriCloud