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

Fix compilation of nested super(...) calls #14709

Merged
merged 3 commits into from Jul 1, 2022

Conversation

dbacarel
Copy link
Contributor

@dbacarel dbacarel commented Jun 30, 2022

Q                       A
Fixed Issues? Fixes #14652
Patch: Bug Fix? transform-classes
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

The bug along with the fix are described in details in the issue. No need to duplicate I think .

@babel-bot
Copy link
Collaborator

babel-bot commented Jun 30, 2022

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

@nicolo-ribaudo
Copy link
Member

I edited your description adding "Fixes" before the issue number. By doing so, it will be automatically closed when this PR is merged 🙂

@nicolo-ribaudo
Copy link
Member

The failing tests is a network error, I'll restart it.

@dbacarel
Copy link
Contributor Author

I edited your description adding "Fixes" before the issue number. By doing so, it will be automatically closed when this PR is merged 🙂

oh right, thanks!

@@ -399,22 +399,22 @@ export default function transformClass(
);
}

const bareSupers = new Set<NodePath<t.CallExpression>>();
const bareSupers = new Array<NodePath<t.CallExpression>>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit:

Suggested change
const bareSupers = new Array<NodePath<t.CallExpression>>();
const bareSupers: NodePath<t.CallExpression>[] = [];

will be shorter.

Copy link
Member

Choose a reason for hiding this comment

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

Also, new Array is usually considered badTM because as soon as you start passing arguments to it it has inconsistent behaviors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👌 done

Copy link
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

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

Thanks.

@liuxingbaoyu liuxingbaoyu added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Jul 1, 2022
@nicolo-ribaudo nicolo-ribaudo changed the title Fixed bug when using multiple super calls (#14652) Fix compilation of nested super(...) calls Jul 1, 2022
@nicolo-ribaudo nicolo-ribaudo merged commit 3c14351 into babel:main Jul 1, 2022
@nicolo-ribaudo
Copy link
Member

Thanks!

@dbacarel dbacarel deleted the fix-multiple-super-calls branch July 1, 2022 12:50
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 1, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue 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.

[Bug]: More Than One Super Call in the Construction is Incorrectly Allowed
5 participants