Fix single optional arrow param printing (#1002)

master
Dan Harper 2017-03-15 16:38:13 +00:00 committed by Christopher Chedeau
parent a2b560887c
commit 332babe77d
3 changed files with 4 additions and 0 deletions

View File

@ -315,6 +315,7 @@ function genericPrintNoParens(path, options, print) {
!n.params[0].typeAnnotation &&
!n.params[0].leadingComments &&
!n.params[0].trailingComments &&
!n.params[0].optional &&
!n.predicate &&
!n.returnType
) {

View File

@ -30,6 +30,7 @@ x => ({}().b);
(a => b)::c;
a::(b => c);
a = b => c;
a = (b?) => c;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(a => {}).length;
typeof (() => {});
@ -61,6 +62,7 @@ x => ({}().b);
(a => b)::c;
a::(b => c);
a = b => c;
a = (b?) => c;
"
`;

View File

@ -27,3 +27,4 @@ x => ({}().b);
(a => b)::c;
a::(b => c);
a = b => c;
a = (b?) => c;