summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorMartin Probst <martin@probst.io>2016-05-29 14:41:07 +0000
committerMartin Probst <martin@probst.io>2016-05-29 14:41:07 +0000
commit409697ecb962d025ae06b18885ea3aa59e48f343 (patch)
tree42fcd4cb21b44a3f9d36c826ee7da05ba28e95a8 /clang/unittests/Format/FormatTestJS.cpp
parent1244ecbbd2072aa13f2bde79c00130486d9e7c78 (diff)
downloadbcm5719-llvm-409697ecb962d025ae06b18885ea3aa59e48f343.tar.gz
bcm5719-llvm-409697ecb962d025ae06b18885ea3aa59e48f343.zip
clang-format: [JS] fix async parsing.
Summary: Only treat the sequence `async function` as the start of a function expression, as opposed to every occurrence of the token `async` (whoops). Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D20737 llvm-svn: 271184
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 457298704d8..33fd065ce49 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -354,6 +354,10 @@ TEST_F(FormatTestJS, AsyncFunctions) {
verifyFormat("class X {\n"
" async asyncMethod() { return fetch(1); }\n"
"}");
+ verifyFormat("function initialize() {\n"
+ " // Comment.\n"
+ " return async.then();\n"
+ "}\n");
}
TEST_F(FormatTestJS, ArrayLiterals) {
OpenPOWER on IntegriCloud