This is an archive of the discontinued LLVM Phabricator instance.

clang-format: [JS] parse async function declarations.
ClosedPublic

Authored by mprobst on Apr 27 2017, 6:02 AM.

Details

Summary

Previously, clang-format would accidentally parse an async function
declaration as a function expression, and thus not insert an unwrapped
line for async functions, causing subsequent functions to run into the
function:

async function f() {
  x();
} function g() { ...

With this change, async functions get parsed as top level function
declarations and get their own unwrapped line context.

Diff Detail

Repository
rL LLVM

Event Timeline

mprobst created this revision.Apr 27 2017, 6:02 AM
djasper accepted this revision.Apr 27 2017, 6:14 AM

Looks good.

lib/Format/UnwrappedLineParser.cpp
1043 ↗(On Diff #96905)

Nit: I'd start this and the next sentence upper case.

This revision is now accepted and ready to land.Apr 27 2017, 6:14 AM
mprobst updated this revision to Diff 96908.Apr 27 2017, 6:19 AM
  • capitalization
mprobst marked an inline comment as done.Apr 27 2017, 6:19 AM
This revision was automatically updated to reflect the committed changes.