-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Support parsing export default abstract class {}
#7075
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/6276/ |
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.
LGTM.
If the comment I wrote makes make flow
report errors, just leave it as is.
I edited Fixes #7060
-> Fixes (partially) #7060
in the pr description to prevent GitHub from closing that issue when this PR is merged, since @dec abstract class
still doesn't work.
@@ -1373,6 +1354,27 @@ export default class StatementParser extends ExpressionParser { | |||
return this.finishNode(node, "ExportNamedDeclaration"); | |||
} | |||
|
|||
parseExportDefaultExpression(): N.Expression { |
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.
This return type should be N.Expression | N.Declaration
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.
Thank you!
Supports parsing a class expression in
export default
that starts with theabstract
keyword.This does not allow parsing
abstract class
as an expression in general, because TypeScript only allows those in declaration positions (and treatsexport default abstract class
as a declaration).