Fix tests

master
Christopher Chedeau 2017-03-22 10:20:42 -07:00
parent dc0fbf7822
commit dd792a2b22
2 changed files with 11 additions and 12 deletions

View File

@ -2204,7 +2204,8 @@ function printFunctionParams(path, print, options) {
// b,
// c
// }) {}
if (fun.params.length === 1 &&
if (fun.params &&
fun.params.length === 1 &&
!fun.params[0].comments &&
(fun.params[0].type === "ObjectPattern" ||
fun.params[0].type === "FunctionTypeParam" &&

View File

@ -13,16 +13,14 @@ exports[`flow_object_comment.js 1`] = `
},
) => {}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export default (
{
foo,
bar
}: {
// comment
foo?: Object,
// comment 2
bar?: Object
}
) => {};
export default ({
foo,
bar
}: {
// comment
foo?: Object,
// comment 2
bar?: Object
}) => {};
"
`;