Add method property to ObjectTypeProperty (#7005)

This commit is contained in:
Brian Ng
2017-12-11 09:32:16 -06:00
committed by GitHub
parent 42f66782be
commit f5ef928586
54 changed files with 1491 additions and 16 deletions

View File

@@ -751,6 +751,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
let optional = false;
if (this.isRelational("<") || this.match(tt.parenL)) {
// This is a method property
node.method = true;
if (variance) {
this.unexpected(variance.start);
}
@@ -763,6 +765,9 @@ export default (superClass: Class<Parser>): Class<Parser> =>
}
} else {
if (kind !== "init") this.unexpected();
node.method = false;
if (this.eat(tt.question)) {
optional = true;
}