summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2016-02-07 22:17:13 +0000
committerDaniel Jasper <djasper@google.com>2016-02-07 22:17:13 +0000
commit9f4c9d418f549b45b654eb98cacc7c40cca8e522 (patch)
tree650c5c3f7ea6f983b3eca41478e623a0848f993c /clang/lib/Format
parentd64186f5dad36c419d95dc76130c74b76ca59892 (diff)
downloadbcm5719-llvm-9f4c9d418f549b45b654eb98cacc7c40cca8e522.tar.gz
bcm5719-llvm-9f4c9d418f549b45b654eb98cacc7c40cca8e522.zip
clang-format: [JS] Don't count shortened object literals as blocks.
Before: f({a}, () => { g(); // }); After: f({a}, () => { g(); // }); llvm-svn: 260060
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 2089d9d3165..a53cceb9a30 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -423,7 +423,7 @@ private:
}
void updateParameterCount(FormatToken *Left, FormatToken *Current) {
- if (Current->is(tok::l_brace) && !Current->is(TT_DictLiteral))
+ if (Current->is(tok::l_brace) && Current->BlockKind == BK_Block)
++Left->BlockParameterCount;
if (Current->is(tok::comma)) {
++Left->ParameterCount;
OpenPOWER on IntegriCloud