diff options
author | Martin Probst <martin@probst.io> | 2017-05-15 19:33:20 +0000 |
---|---|---|
committer | Martin Probst <martin@probst.io> | 2017-05-15 19:33:20 +0000 |
commit | 661305755fa87aba0b986c29af718ece39624778 (patch) | |
tree | 145df9eefca78728b9fa5969b363e1117a6be40c /unittests | |
parent | 600a9e6e11f067dbb921c742b6fb676e0ac045bd (diff) |
clang-format: [JS] for async loops.
Summary:
JavaScript supports asynchronous loop iteration in async functions:
for async (const x of y) ...
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D33193
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303106 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Format/FormatTestJS.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/unittests/Format/FormatTestJS.cpp b/unittests/Format/FormatTestJS.cpp index b556e995d1..ff28f304be 100644 --- a/unittests/Format/FormatTestJS.cpp +++ b/unittests/Format/FormatTestJS.cpp @@ -548,6 +548,15 @@ TEST_F(FormatTestJS, AsyncFunctions) { " // Comment.\n" " return async.then();\n" "}\n"); + verifyFormat("for async (const x of y) {\n" + " console.log(x);\n" + "}\n"); + verifyFormat("function asyncLoop() {\n" + " for async (const x of y) {\n" + " console.log(x);\n" + " }\n" + "}\n"); + } TEST_F(FormatTestJS, FunctionParametersTrailingComma) { |