Skip to content

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

Merged
nicolo-ribaudo merged 3 commits intobabel:mainfrom
dbacarel:fix-multiple-super-calls
Jul 1, 2022
Merged

Fix compilation of nested super(...) calls#14709
nicolo-ribaudo merged 3 commits intobabel:mainfrom
dbacarel:fix-multiple-super-calls

Conversation

@dbacarel
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

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

@dbacarel
Copy link
Copy Markdown
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!

}

const bareSupers = new Set<NodePath<t.CallExpression>>();
const bareSupers = new Array<NodePath<t.CallExpression>>();
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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