if (Right.is(tok::l_paren)) {
if (Left.is(tok::r_paren) && Left.is(TT_AttributeParen))
return true;
- return Line.Type == LT_ObjCDecl ||
- Left.isOneOf(tok::kw_new, tok::kw_delete, tok::semi) ||
+ return Line.Type == LT_ObjCDecl || Left.is(tok::semi) ||
(Style.SpaceBeforeParens != FormatStyle::SBPO_Never &&
(Left.isOneOf(tok::kw_if, tok::kw_for, tok::kw_while,
tok::kw_switch, tok::kw_case) ||
- (Left.is(tok::kw_catch) &&
+ (Left.isOneOf(tok::kw_catch, tok::kw_new, tok::kw_delete) &&
(!Left.Previous || Left.Previous->isNot(tok::period))) ||
Left.IsForEachMacro)) ||
(Style.SpaceBeforeParens == FormatStyle::SBPO_Always &&
// But, of course, "catch" is a perfectly fine function name in JavaScript.
verifyFormat("someObject.catch();");
+ verifyFormat("someObject.new();");
+ verifyFormat("someObject.delete();");
}
TEST_F(FormatTestJS, StringLiteralConcatenation) {