Disallow const let or let let
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user