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

Allow variable and function with the same name in static blocks #14344

Merged
merged 10 commits into from Mar 10, 2022

Conversation

Yokubjon-J
Copy link
Contributor

@Yokubjon-J Yokubjon-J commented Mar 9, 2022

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

Allow a variable and a function to have a same name in a static block

@babel-bot
Copy link
Collaborator

babel-bot commented Mar 9, 2022

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

@Yokubjon-J
Copy link
Contributor Author

I wonder why babel bot shows another issue (not about static block) in REPL...

@nicolo-ribaudo nicolo-ribaudo changed the title Fix 14336 Allow variable and function with the same name in static blocks Mar 9, 2022
@nicolo-ribaudo nicolo-ribaudo added pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories Spec: Class Static Block labels Mar 9, 2022
@nicolo-ribaudo
Copy link
Member

You can edit the REPL contents to whatever you want 😉

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.

The CI failure is not related to this PR, it's a flaky test that sometimes fails.

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.

static block is an ES2022 feature, can you move the test case to es2022? There is a static block folder over there. I think it suffices to add only one test case.

@Yokubjon-J
Copy link
Contributor Author

I have created a new subdirectory: ...\es2022\class-private-names-duplicated\static-block-duplicate-name. The test has passed.

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!

@JLHwung JLHwung merged commit bae5027 into babel:main Mar 10, 2022
@nicolo-ribaudo nicolo-ribaudo deleted the fix-14336 branch March 10, 2022 19:12
@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 Jun 10, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 10, 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 pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories Spec: Class Static Block
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Parser throws when var declaration and function declaration in class static block
4 participants