Fix regression with let (#9477)

* Fix corner cases with let

* Handle generators correctly

* Fix flow plugin

* Fix typescript plugin
This commit is contained in:
Daniel Tschinder
2019-02-08 13:36:37 -08:00
committed by GitHub
parent 7943a48cc3
commit 2817844e89
20 changed files with 728 additions and 242 deletions

View File

@@ -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;