Skip to content
Commit 8e3eba03 authored by Martin Probst's avatar Martin Probst
Browse files

clang-format: [JS] correcly format object literal methods.

Summary:
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 try
parsing as a braced list, but fall back to parsing as a child block.

Reviewers: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D29656

llvm-svn: 294315
parent f86708db
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment