clang-format: [JS] whitespace after async in arrow functions.
Summary:
Async arrow functions should be marked with a whitespace after the async keyword, before the parameter list:
x = async () => foo();
Before:
x = async() => foo();
This makes it easier to tell apart an async arrow function from a call to a function called async.
Reviewers: bkramer
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D30399
llvm-svn: 296330
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index fe87bf2..112b124 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -463,6 +463,8 @@
verifyFormat("export async function f() {\n"
" return fetch(x);\n"
"}");
+ verifyFormat("let x = async () => f();");
+ verifyFormat("let x = async();");
verifyFormat("class X {\n"
" async asyncMethod() {\n"
" return fetch(1);\n"