This revision was automatically updated to reflect the committed changes.
Closed by commit rL294315: clang-format: [JS] correcly format object literal
methods. (authored by mprobst).
Changed prior to commit:
https://reviews.llvm.org/D29656?vs=87456&id=87462#toc
Repository:
rL LLVM
https://r
mprobst created this revision.
Herald added a subscriber: klimek.
In JavaScript, object literals can contain methods:
var x = {
a() { return 1; },
};
Previously, clang-format always parsed nested {} inside a braced list as
further braced lists. Special case this logic for JavaScript to t
djasper accepted this revision.
djasper added inline comments.
This revision is now accepted and ready to land.
Comment at: lib/Format/UnwrappedLineParser.cpp:1306
+// Could be a method inside of a braced list `{a() { return 1; }}`.
+if (tryToParseBracedList()) {