mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-29 00:21:14 +00:00
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
This commit is contained in:
parent
aa47cf9dae
commit
cd8d4ff985
@ -1321,7 +1321,7 @@ private:
|
||||
else if (Current->is(TT_LambdaArrow))
|
||||
return prec::Comma;
|
||||
else if (Current->isOneOf(tok::semi, TT_InlineASMColon,
|
||||
TT_SelectorName) ||
|
||||
TT_SelectorName, TT_JsComputedPropertyName) ||
|
||||
(Current->is(tok::comment) && NextNonComment &&
|
||||
NextNonComment->is(TT_SelectorName)))
|
||||
return 0;
|
||||
|
@ -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"
|
||||
"};");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user