summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorMartin Probst <martin@probst.io>2017-11-24 17:05:56 +0000
committerMartin Probst <martin@probst.io>2017-11-24 17:05:56 +0000
commitce2bd4dfd8d56512acd9f4c79f2894703e5977f1 (patch)
treec29320fe598d43efd1420d69003cab87819ed165 /clang/unittests/Format/FormatTestJS.cpp
parenta5968aad3da0407ff7aaae3a47f665ea7daac709 (diff)
downloadbcm5719-llvm-ce2bd4dfd8d56512acd9f4c79f2894703e5977f1.tar.gz
bcm5719-llvm-ce2bd4dfd8d56512acd9f4c79f2894703e5977f1.zip
clang-format: [JS] do not break in ArrayType[].
Summary: Wrapping between the type name and the array type indicator creates invalid syntax in TypeScript. Before: const xIsALongIdent: YJustBarelyFitsLinex []; // illegal syntax. After: const xIsALongIdent: YJustBarelyFitsLinex[]; Reviewers: djasper Subscribers: klimek Differential Revision: https://reviews.llvm.org/D40436 llvm-svn: 318959
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 2665c8b428e..a1075991885 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -1426,6 +1426,8 @@ TEST_F(FormatTestJS, TypeAnnotations) {
verifyFormat(
"var someValue = (v as aaaaaaaaaaaaaaaaaaaa<T>[])\n"
" .someFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);");
+ verifyFormat("const xIsALongIdent:\n"" YJustBarelyFitsLinex[];",
+ getGoogleJSStyleWithColumns(20));
}
TEST_F(FormatTestJS, UnionIntersectionTypes) {
OpenPOWER on IntegriCloud