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

Properly transpile exported classes that shadowed builtins #15294

Merged
merged 1 commit into from Dec 22, 2022

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Dec 21, 2022

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

This is a hotfix for #15293. See below for the root cause analysis.

In the future we should revisit how and when the helpers are injected.

@JLHwung JLHwung added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Dec 21, 2022
@babel-bot
Copy link
Collaborator

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

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Dec 22, 2022

See below for the root cause analysis.

Below where? 😅

EDIT: Found it, it's a comment in the code.

@nicolo-ribaudo
Copy link
Member

Fwiw, I'm working on a @babel/parser,/@babel/traverse/@babel/generator RFC to track bindings using an UID instead of their name, so that even if there are conflicts (e.g. Number in the class name and in the helper), our logic will still be able to distinguish them (because they would have different UIDs) and we only need to rename one while printing to prevent the generated JS code from having the same conflict.

Copy link
Member

@liuxingbaoyu liuxingbaoyu left a comment

Choose a reason for hiding this comment

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

It's annoying that parent and parentNode are different.

@nicolo-ribaudo nicolo-ribaudo merged commit fad1c80 into babel:main Dec 22, 2022
@nicolo-ribaudo nicolo-ribaudo deleted the fix-15293 branch December 22, 2022 14:33
@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 Mar 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2023
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]: Could not transpile code with enabled preset-env
4 participants