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

nicolo-ribaudo commented Jun 30, 2022

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

nicolo-ribaudo commented Jun 30, 2022

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

@dbacarel
Copy link
Contributor Author

dbacarel commented Jun 30, 2022

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

@JLHwung JLHwung Jun 30, 2022

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

@nicolo-ribaudo nicolo-ribaudo Jul 1, 2022

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

@dbacarel dbacarel Jul 1, 2022

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

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
35 checks passed
@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Jul 1, 2022

Thanks!

@dbacarel dbacarel deleted the fix-multiple-super-calls branch Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants