register ImportEqualsSpecifier to scope (#10710)

Co-authored-by: <jaejoon.choi>
This commit is contained in:
Huáng Jùnliàng
2019-11-18 13:04:34 -05:00
committed by GitHub
parent faf149226b
commit cfd26fdbf2
3 changed files with 180 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ import {
BIND_TS_AMBIENT,
BIND_TS_NAMESPACE,
BIND_CLASS,
BIND_LEXICAL,
} from "../../util/scopeflags";
import TypeScriptScopeHandler from "./scope";
import * as charCodes from "charcodes";
@@ -1292,6 +1293,12 @@ export default (superClass: Class<Parser>): Class<Parser> =>
): N.TsImportEqualsDeclaration {
node.isExport = isExport || false;
node.id = this.parseIdentifier();
this.checkLVal(
node.id,
BIND_LEXICAL,
undefined,
"import equals declaration",
);
this.expect(tt.eq);
node.moduleReference = this.tsParseModuleReference();
this.semicolon();