Support changes in flow parsing
This commit is contained in:
parent
dc525edf51
commit
ad0e1ba6de
@ -187,6 +187,20 @@ export function TypeAnnotation(node: Object) {
|
||||
this.print(node.typeAnnotation, node);
|
||||
}
|
||||
|
||||
export function TypeParameter(node: Object) {
|
||||
if (node.variance === "plus") {
|
||||
this.push("+");
|
||||
} else if (node.variance === "minus") {
|
||||
this.push("-");
|
||||
}
|
||||
|
||||
this.push(node.name);
|
||||
|
||||
if (node.bound) {
|
||||
this.print(node.bound, node);
|
||||
}
|
||||
}
|
||||
|
||||
export function TypeParameterInstantiation(node: Object) {
|
||||
this.push("<");
|
||||
this.printJoin(node.params, node, {
|
||||
|
||||
@ -4,16 +4,6 @@
|
||||
import * as t from "babel-types";
|
||||
|
||||
export function Identifier(node: Object) {
|
||||
// FIXME: We hang variance off Identifer to support Flow's def-site variance.
|
||||
// This is a terrible hack, but changing type annotations to use a new,
|
||||
// dedicated node would be a breaking change. This should be cleaned up in
|
||||
// the next major.
|
||||
if (node.variance === "plus") {
|
||||
this.push("+");
|
||||
} else if (node.variance === "minus") {
|
||||
this.push("-");
|
||||
}
|
||||
|
||||
this.push(node.name);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user