summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-05-31 08:40:37 +0000
committerDaniel Jasper <djasper@google.com>2015-05-31 08:40:37 +0000
commitcd8d4ff98598b3234181e826a7a900eecf9bd455 (patch)
tree8cecaf18dd6691cbd915d54f5049ff4691deb75b /clang/unittests/Format/FormatTestJS.cpp
parentaa47cf9dae55180bdbddbc93ee037bba529f5a24 (diff)
downloadbcm5719-llvm-cd8d4ff98598b3234181e826a7a900eecf9bd455.tar.gz
bcm5719-llvm-cd8d4ff98598b3234181e826a7a900eecf9bd455.zip
clang-format: [JS] Fix line breaks in computed property names.
Before: let foo = { [someLongKeyHere]: 1, someOtherLongKeyHere: 2, [keyLongEnoughToWrap]: 3, lastLongKey: 4 }; After: let foo = { [someLongKeyHere]: 1, someOtherLongKeyHere: 2, [keyLongEnoughToWrap]: 3, lastLongKey: 4 }; llvm-svn: 238671
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index d95ff9ba834..29b8aa1ff13 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -153,8 +153,11 @@ TEST_F(FormatTestJS, ContainerLiterals) {
verifyFormat("var x = {y: (a) => a};");
// Computed keys.
+ verifyFormat("var x = {[a]: 1, b: 2, [c]: 3};");
verifyFormat("var x = {\n"
" [a]: 1,\n"
+ " b: 2,\n"
+ " [c]: 3,\n"
"};");
}
OpenPOWER on IntegriCloud