Before:
return {
a: a,
link:
function() {
f(); //
},
link:
function() {
f(); //
}
};
After:
return {
a: a,
link: function() {
f(); //
},
link: function() {
f(); //
}
};
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217238
91177308-0d34-0410-b5e6-
96231b3b80d8
State.Stack[State.Stack.size() - 2].JSFunctionInlined = false;
}
if (Current.TokenText == "function")
- State.Stack.back().JSFunctionInlined = !Newline;
+ State.Stack.back().JSFunctionInlined =
+ !Newline && Previous && Previous->Type != TT_DictLiteral;
}
moveStatePastFakeLParens(State, Newline);
"};");
verifyFormat("return {\n"
" a: a,\n"
- " link:\n"
- " function() {\n"
- " f(); //\n"
- " },\n"
- " link:\n"
- " function() {\n"
- " f(); //\n"
- " }\n"
+ " link: function() {\n"
+ " f(); //\n"
+ " },\n"
+ " link: function() {\n"
+ " f(); //\n"
+ " }\n"
"};");
verifyFormat("var stuff = {\n"
" // comment for update\n"