Fix single optional arrow param printing (#1002)

This commit is contained in:
Dan Harper authored and Christopher Chedeau committed 2017-03-15 09:38:13 -07:00
1 parent a2b560887c
commit 332babe77d
3 files changed
+4

No files matched your search

+1
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
) {
@@ -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;
"
`;
@@ -27,3 +27,4 @@ x => ({}().b);
(a => b)::c;
a::(b => c);
a = b => c;
a = (b?) => c;