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
@babel/parser(ts): exported abstract interface is parsed as a class #9304
Comments
Hey @armano2! We really appreciate you taking the time to report an issue. The collaborators If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack |
looks like issue is more serious, abstract is parsed incorrectly: export abstract foo Bar {} will be parsed to
|
in case of export https://github.com/babel/babel/blob/master/packages/babel-parser/src/plugins/typescript.js#L1265 case "abstract":
if (next || this.match(tt._class)) {
const cls: N.ClassDeclaration = node;
cls.abstract = true;
if (next) this.next();
return this.parseClass(
cls,
/* isStatement */ true,
/* optionalId */ false,
);
}
break; next is set to true, and there is no check for keyword anywhere |
Bug Report
Current Behavior
Exported
abstract interface
is parsed by babel/parser as a class, this is only a case when its exportedInput Code
Expected behavior/code
I expect error that
abstract
keyword is not allowed.Babel Configuration (.babelrc, package.json, cli command)
Additional context/Screenshots
)Environment
parse
The text was updated successfully, but these errors were encountered: