diff options
| author | Martin Probst <martin@probst.io> | 2016-05-29 14:41:07 +0000 |
|---|---|---|
| committer | Martin Probst <martin@probst.io> | 2016-05-29 14:41:07 +0000 |
| commit | 409697ecb962d025ae06b18885ea3aa59e48f343 (patch) | |
| tree | 42fcd4cb21b44a3f9d36c826ee7da05ba28e95a8 /clang/unittests/Format/FormatTestJS.cpp | |
| parent | 1244ecbbd2072aa13f2bde79c00130486d9e7c78 (diff) | |
| download | bcm5719-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.cpp | 4 |
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) { |

