summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorMartin Probst <martin@probst.io>2016-06-22 14:35:14 +0000
committerMartin Probst <martin@probst.io>2016-06-22 14:35:14 +0000
commitdce8e4173bfb6ed3f858de8d5991fd87fac2946b (patch)
tree6a1d20e8f43fa3c8d43dd7e342e1bcd8518d4432 /clang/unittests/Format/FormatTestJS.cpp
parentc6cacd606758f37f7739b6784575bb4a4463d82b (diff)
downloadbcm5719-llvm-dce8e4173bfb6ed3f858de8d5991fd87fac2946b.tar.gz
bcm5719-llvm-dce8e4173bfb6ed3f858de8d5991fd87fac2946b.zip
clang-format: [JS] Do not break before 'as'.
Summary: 'as' is a pseudo operator, so automatic semicolon insertion kicks in and the code fails to part. Reviewers: djasper Subscribers: klimek Differential Revision: http://reviews.llvm.org/D21576 llvm-svn: 273422
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index f71571c16a3..4feb55dae24 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -1051,8 +1051,8 @@ TEST_F(FormatTestJS, Modules) {
// ... but not if from is just an identifier.
verifyFormat("export {\n"
" from as from,\n"
- " someSurprisinglyLongVariable\n"
- " as from\n"
+ " someSurprisinglyLongVariable as\n"
+ " from\n"
"};",
getGoogleJSStyleWithColumns(20));
verifyFormat("export class C {\n"
@@ -1205,6 +1205,9 @@ TEST_F(FormatTestJS, TemplateStrings) {
TEST_F(FormatTestJS, CastSyntax) {
verifyFormat("var x = <type>foo;");
verifyFormat("var x = foo as type;");
+ verifyFormat("let x = (a + b) as\n"
+ " LongTypeIsLong;",
+ getGoogleJSStyleWithColumns(20));
verifyFormat("foo = <Bar[]>[\n"
" 1, //\n"
" 2\n"
OpenPOWER on IntegriCloud