Disallow const let or let let

This commit is contained in:
Daniel Tschinder
2019-01-21 23:38:27 -08:00
parent 178f2d7949
commit 8071dca9ad
4 changed files with 15 additions and 10 deletions

View File

@@ -2344,8 +2344,11 @@ export default (superClass: Class<Parser>): Class<Parser> =>
}
// parse flow type annotations on variable declarator heads - let foo: string = bar
parseVarHead(decl: N.VariableDeclarator): void {
super.parseVarHead(decl);
parseVarId(
decl: N.VariableDeclarator,
kind: "var" | "let" | "const",
): void {
super.parseVarId(decl, kind);
if (this.match(tt.colon)) {
decl.id.typeAnnotation = this.flowParseTypeAnnotation();
this.finishNode(decl.id, decl.id.type);