New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
register import equals specifier #10710
Conversation
Note that you can mark them as "co-author" of the commit |
Co-authored-by: <jaejoon.choi>
Rebased |
@@ -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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about which kind of binding this should be: https://www.typescriptlang.org/play/?esModuleInterop=false&target=99&module=1&ssl=3&ssc=17&pln=4&pc=17#code/JYWwDg9gTgLgBAQzgXjlApgRwK7AwCgCIFCBKAbgChKYBPMdRFOAO2xACN0oqAbdeAgBcrdlyjMATFUroAHpFhwA3kwC+5IA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The binding type should be as same as import default specifier: https://www.typescriptlang.org/play/?esModuleInterop=false&target=99&module=1&ssl=1&ssc=1&pln=3&pc=1#code/JYWwDg9gTgLgBAQzgXjlApgRwK7AwCgCIYBPMdAZwGMpgwZCBKAbgChXTzEU4A7bEACN0UNgBt08BAC4+A4VB4AmNq3QAPSLDgBvbgF9mQA
The declaration conflict error is shadowed by the module-not-found.
In this PR we register the import equals specifier so that it would not throw if it appears in an export named declaration later.
Note that we does not support transforming ImportEqualsDeclaration yet, but we should be able to parse it.
Credits to @jj-choi