Support Flow this parameter annotations (#12234)

This commit is contained in:
Daniel Sainati
2021-02-21 11:44:27 -05:00
committed by GitHub
parent 407e8b5c7b
commit 16e9f1c8e5
149 changed files with 3010 additions and 83 deletions

View File

@@ -289,6 +289,18 @@ export function FunctionTypeAnnotation(
) {
this.print(node.typeParameters, node);
this.token("(");
if (node.this) {
this.word("this");
this.token(":");
this.space();
this.print(node.this.typeAnnotation, node);
if (node.params.length || node.rest) {
this.token(",");
this.space();
}
}
this.printList(node.params, node);
if (node.rest) {