fix TSTypeReference not printing typeArguments (#1392)

This commit is contained in:
Danny Arnold authored and Christopher Chedeau committed 2017-04-23 08:31:50 -07:00
1 parent 15df9abf81
commit 150c701191
4 files changed
+24 -1

No files matched your search

+11 -1
View File
@@ -1918,7 +1918,17 @@ function genericPrintNoParens(path, options, print, args) {
return concat(parts);
case "TSTypeReference":
return concat([path.call(print, "typeName")]);
parts.push(path.call(print, "typeName"))
if (n.typeArguments) {
parts.push(
"<",
join(", ", path.map(print, "typeArguments")),
">"
)
}
return concat(parts);
case "TSCallSignature":
return concat([
"(",
@@ -0,0 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`typeReference.ts 1`] = `
let n: Promise<number>
let m: Map<number, string>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
let n: Promise<number>;
let m: Map<number, string>;
`;
@@ -0,0 +1 @@
run_spec(__dirname, { parser: "typescript" });
@@ -0,0 +1,2 @@
let n: Promise<number>
let m: Map<number, string>