Before:
var someVariable =
function(x) { return x.zIsTooLongForOneLineWithTheDeclarationLine(); };
After:
var someVariable = function(x) {
return x.zIsTooLongForOneLineWithTheDeclarationLine();
};
llvm-svn: 222893
return 2;
if (Left.is(tok::comma) && Left.NestingLevel == 0)
return 3;
+ } else if (Style.Language == FormatStyle::LK_JavaScript) {
+ if (Right.is(Keywords.kw_function))
+ return 100;
}
if (Left.is(tok::comma) || (Right.is(tok::identifier) && Right.Next &&
return 0;
if (Left.is(tok::colon) && Left.is(TT_ObjCMethodExpr))
return Line.MightBeFunctionDecl ? 50 : 500;
- if (Left.is(tok::colon) && Left.is(TT_DictLiteral))
- return 100;
if (Left.is(tok::l_paren) && InFunctionDecl && Style.AlignAfterOpenBracket)
return 100;
" };\n"
" }\n"
"};");
+ verifyFormat("{\n"
+ " var someVariable = function(x) {\n"
+ " return x.zIsTooLongForOneLineWithTheDeclarationLine();\n"
+ " };\n"
+ "}");
verifyFormat("var x = {a: function() { return 1; }};",
getGoogleJSStyleWithColumns(38));