fix TSFunctionType (#1600)

master
Danny Martini 2017-05-13 00:33:03 +02:00 committed by Christopher Chedeau
parent 2fc6024a20
commit c86a57a91e
2 changed files with 27 additions and 31 deletions

View File

@ -61,7 +61,6 @@
"tests/typescript/conformance/types/variableDeclarator/jsfmt.spec.js",
"tests/typescript/conformance/types/typeParameter/jsfmt.spec.js",
"tests/typescript/custom/computedProperties/jsfmt.spec.js",
"tests/typescript/conformance/types/functions/jsfmt.spec.js",
"tests/typescript/custom/new/jsfmt.spec.js",
"tests/typescript/custom/call/jsfmt.spec.js",
"tests/typescript/custom/typeParameters/jsfmt.spec.js",

View File

@ -2732,11 +2732,8 @@ function printArgumentsList(path, options, print) {
function printFunctionTypeParameters(path, options, print) {
const fun = path.getValue();
// With TypeScript `typeParameters` is an array of `TSTypeParameter` and
// with flow they are one `TypeParameterDeclaration` node.
if (fun.type === "TSFunctionType") {
return printTypeParameters(path, options, print, "typeParameters")
} else if (fun.typeParameters) {
if (fun.typeParameters) {
return path.call(print, "typeParameters");
} else {
return "";