This is an archive of the discontinued LLVM Phabricator instance.

clang-format: [JS] prevent wraps before class members.
ClosedPublic

Authored by mprobst on Apr 26 2017, 4:15 AM.

Details

Summary

In JavaScript/TypeScript, class member definitions that use modifiers can be subject to Automatic Semicolon Insertion (ASI). For example, "class X { get \n foo }" defines a property called "get" and a property called "foo", both with no type annotation. This change prevents wrapping after the modifier keywords (visibility modifiers, static, get and set) to prevent accidental ASI.

Diff Detail

Repository
rL LLVM

Event Timeline

mprobst created this revision.Apr 26 2017, 4:15 AM
mprobst updated this revision to Diff 96712.Apr 26 2017, 4:45 AM
  • formatting
djasper accepted this revision.Apr 26 2017, 5:32 AM

Looks good.

This revision is now accepted and ready to land.Apr 26 2017, 5:32 AM
This revision was automatically updated to reflect the committed changes.