Fix regression with let (#9477)
* Fix corner cases with let * Handle generators correctly * Fix flow plugin * Fix typescript plugin
This commit is contained in:
@@ -1566,7 +1566,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
}
|
||||
|
||||
// interfaces
|
||||
parseStatement(declaration: boolean, topLevel?: boolean): N.Statement {
|
||||
parseStatement(context: ?string, topLevel?: boolean): N.Statement {
|
||||
// strict mode handling of `interface` since it's a reserved word
|
||||
if (
|
||||
this.state.strict &&
|
||||
@@ -1577,7 +1577,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
this.next();
|
||||
return this.flowParseInterface(node);
|
||||
} else {
|
||||
const stmt = super.parseStatement(declaration, topLevel);
|
||||
const stmt = super.parseStatement(context, topLevel);
|
||||
// We will parse a flow pragma in any comment before the first statement.
|
||||
if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {
|
||||
this.flowPragma = null;
|
||||
|
||||
@@ -1699,10 +1699,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
return super.parseExportDefaultExpression();
|
||||
}
|
||||
|
||||
parseStatementContent(
|
||||
declaration: boolean,
|
||||
topLevel: ?boolean,
|
||||
): N.Statement {
|
||||
parseStatementContent(context: ?string, topLevel: ?boolean): N.Statement {
|
||||
if (this.state.type === tt._const) {
|
||||
const ahead = this.lookahead();
|
||||
if (ahead.type === tt.name && ahead.value === "enum") {
|
||||
@@ -1712,7 +1709,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
return this.tsParseEnumDeclaration(node, /* isConst */ true);
|
||||
}
|
||||
}
|
||||
return super.parseStatementContent(declaration, topLevel);
|
||||
return super.parseStatementContent(context, topLevel);
|
||||
}
|
||||
|
||||
parseAccessModifier(): ?N.Accessibility {
|
||||
|
||||
Reference in New Issue
Block a user