diff options
author | Daniel Jasper <djasper@google.com> | 2016-11-29 09:40:36 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2016-11-29 09:40:36 +0000 |
commit | e98e58111b16cfe8877965b6cf417a808084597e (patch) | |
tree | a087438abe6bc4db3b8acc52ebf34fb23bb7838f /clang/lib/Format | |
parent | 22ed262c239cac166d67bc30f3ee0aa45bb15745 (diff) | |
download | bcm5719-llvm-e98e58111b16cfe8877965b6cf417a808084597e.tar.gz bcm5719-llvm-e98e58111b16cfe8877965b6cf417a808084597e.zip |
clang-format: [JS] Properly format dict literals that skip labels.
llvm-svn: 288121
Diffstat (limited to 'clang/lib/Format')
-rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index b241fe94909..57f30276b36 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -442,6 +442,9 @@ private: Style.Language == FormatStyle::LK_JavaScript) Left->Type = TT_DictLiteral; } + if (CurrentToken->is(tok::comma) && + Style.Language == FormatStyle::LK_JavaScript) + Left->Type = TT_DictLiteral; if (!consumeToken()) return false; } |