summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorMartin Probst <martin@probst.io>2017-08-01 17:22:15 +0000
committerMartin Probst <martin@probst.io>2017-08-01 17:22:15 +0000
commit22e00f09a0eb7c4669347fa6f13283ef5d55668b (patch)
treed77b65a6cc4287d471ff72e74e7da403737b8319 /clang/unittests/Format/FormatTestJS.cpp
parent11b8731f6bbfbfe00b2e76353bf4416db255c53f (diff)
downloadbcm5719-llvm-22e00f09a0eb7c4669347fa6f13283ef5d55668b.tar.gz
bcm5719-llvm-22e00f09a0eb7c4669347fa6f13283ef5d55668b.zip
clang-format: [JS] whitespace between keywords and parenthesized expressions.
Summary: `throw (...)` should have a whitespace following it, as do await and void. Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D36146 llvm-svn: 309710
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 231026b7c61..4ae6b866b9f 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -259,6 +259,15 @@ TEST_F(FormatTestJS, ReservedWordsMethods) {
"}\n");
}
+TEST_F(FormatTestJS, ReservedWordsParenthesized) {
+ // All of these are statements using the keyword, not function calls.
+ verifyFormat("throw (x + y);\n"
+ "await (await x).y;\n"
+ "void (0);\n"
+ "delete (x.y);\n"
+ "return (x);\n");
+}
+
TEST_F(FormatTestJS, CppKeywords) {
// Make sure we don't mess stuff up because of C++ keywords.
verifyFormat("return operator && (aa);");
OpenPOWER on IntegriCloud