]> granicus.if.org Git - clang/commit
clang-format: [JS] fix indenting bound functions.
authorMartin Probst <martin@probst.io>
Mon, 29 May 2017 07:50:52 +0000 (07:50 +0000)
committerMartin Probst <martin@probst.io>
Mon, 29 May 2017 07:50:52 +0000 (07:50 +0000)
commitac4917bc8b8e6b9b05fdd4c956350df0ed6a1c1c
tree3019c5fc5e4a3a251291d65b110b7d53759565dd
parentc3646e135e2ca9109cd8a9eaa419854fd3486053
clang-format: [JS] fix indenting bound functions.

Summary:
The previous fix to force build style wrapping if the previous token is a closing parenthesis broke a peculiar pattern where users parenthesize the function declaration in a bind call:
    fn((function() { ... }).bind(this));

This restores the previous behaviour by reverting that change, but narrowing the special case for unindenting closing parentheses to those followed by semicolons and opening braces, i.e. immediate calls and function declarations.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304135 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/ContinuationIndenter.cpp
unittests/Format/FormatTestJS.cpp