Allow keywords to be used in type annotations (#9184)

This commit is contained in:
Daniel Tschinder
2018-12-15 12:51:24 -08:00
committed by GitHub
parent 3c8e15dbc1
commit 5cb38995c0
5 changed files with 143 additions and 3 deletions

View File

@@ -1384,6 +1384,10 @@ export default (superClass: Class<Parser>): Class<Parser> =>
default:
if (this.state.type.keyword === "typeof") {
return this.flowParseTypeofType();
} else if (this.state.type.keyword) {
const label = this.state.type.label;
this.next();
return super.createIdentifier(node, label);
}
}