Skip to content
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

Merged
merged 2 commits into from Dec 21, 2017
Merged

Support parsing export default abstract class {} #7075

merged 2 commits into from Dec 21, 2017

Conversation

ghost
Copy link

@ghost ghost commented Dec 20, 2017

Q                       A
Fixed Issues? Fixes (partially) #7060
Patch: Bug Fix? Yes
Major: Breaking Change? No
Minor: New Feature? No
Tests Added + Pass? Yes
Documentation PR No
Any Dependency Changes? No
License MIT

Supports parsing a class expression in export default that starts with the abstract keyword.
This does not allow parsing abstract class as an expression in general, because TypeScript only allows those in declaration positions (and treats export default abstract class as a declaration).

@babel-bot
Copy link
Collaborator

babel-bot commented Dec 20, 2017

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/6276/

@existentialism existentialism added area: typescript pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Dec 20, 2017
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a 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 {
Copy link
Member

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

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@nicolo-ribaudo nicolo-ribaudo merged commit 6a73f39 into babel:master Dec 21, 2017
@ghost ghost deleted the abstract-class branch December 21, 2017 15:39
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: typescript outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants