fix(typescript): fix unstable optional method (#1770)

This commit is contained in:
Lucas Azzola authored and Christopher Chedeau committed 2017-05-27 07:24:54 -07:00
1 parent 59a760c5d8
commit 91bcde9859
4 files changed
+11 -1

No files matched your search

+1 -1
View File
@@ -2354,7 +2354,7 @@ function genericPrintNoParens(path, options, print, args) {
case "TSMethodSignature":
parts.push(
path.call(print, "name"),
n.questionToken ? "?" : "",
n.questionToken && !n.name.optional ? "?" : "",
printFunctionTypeParameters(path, options, print),
printFunctionParams(path, print, options)
);
@@ -0,0 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`type_literal_optional_method.ts 1`] = `
var v: { e?(): number };
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var v: { e?(): number };
`;
+1
View File
@@ -0,0 +1 @@
run_spec(__dirname, { parser: "typescript" });
@@ -0,0 +1 @@
var v: { e?(): number };