This is an archive of the discontinued LLVM Phabricator instance.

clang-format: [JS] whitespace after async in arrow functions.
ClosedPublic

Authored by mprobst on Feb 27 2017, 2:24 AM.

Details

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.

Event Timeline

mprobst created this revision.Feb 27 2017, 2:24 AM
bkramer accepted this revision.Feb 27 2017, 2:34 AM

lg, but I don't really know JS ;)

This revision is now accepted and ready to land.Feb 27 2017, 2:34 AM
djasper added inline comments.Feb 27 2017, 3:13 AM
lib/Format/TokenAnnotator.cpp
2229

As getNextNonComment() walks linearly over the tokens, I'd pull it out into a variable.

mprobst updated this revision to Diff 89859.Feb 27 2017, 3:20 AM
  • Extract local variable for next non comment.
mprobst marked an inline comment as done.Feb 27 2017, 3:20 AM
This revision was automatically updated to reflect the committed changes.