Allow flow class field to be named constructor (#510)

This commit is contained in:
Brian Ng
2017-05-10 09:18:08 -05:00
committed by Daniel Tschinder
parent 0e12f565da
commit 9d1f819320
7 changed files with 409 additions and 0 deletions

View File

@@ -1231,6 +1231,10 @@ export default (superClass: Class<Parser>): Class<Parser> => class extends super
return this.match(tt.colon) || super.isClassProperty();
}
isNonstaticConstructor(method: N.ClassMethod): boolean {
return !this.match(tt.colon) && super.isNonstaticConstructor(method);
}
// parse type parameters for class methods
parseClassMethod(classBody: N.ClassBody, method: N.ClassMethod, ...args): void {
if (method.variance) {