Skip to content

Commit

Permalink
Add ";" token to the end of TS construct & call signature declaration (
Browse files Browse the repository at this point in the history
…#10258)

* Add ";" token to the end of TS construct signature declaration

* Add ";" token to the end of TS call signature declaration. Update construct signature test fixtures
  • Loading branch information
skyiea authored and nicolo-ribaudo committed Jul 25, 2019
1 parent 4d12c89 commit 4d30379
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/babel-generator/src/generators/typescript.js
Expand Up @@ -67,12 +67,14 @@ export function TSQualifiedName(node) {

export function TSCallSignatureDeclaration(node) {
this.tsPrintSignatureDeclarationBase(node);
this.token(";");
}

export function TSConstructSignatureDeclaration(node) {
this.word("new");
this.space();
this.tsPrintSignatureDeclarationBase(node);
this.token(";");
}

export function TSPropertySignature(node) {
Expand Down
@@ -1,3 +1,4 @@
interface I {
(x: number): void;
(x: string): void;
}
@@ -1,3 +1,4 @@
interface I {
(x: number): void
}
(x: number): void;
(x: string): void;
}
@@ -1,3 +1,4 @@
interface I {
new (x: number): void;
new (x: string): void;
}
@@ -1,3 +1,4 @@
interface I {
new (x: number): void
}
new (x: number): void;
new (x: string): void;
}

0 comments on commit 4d30379

Please sign in to comment.