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: do not transform ClassPrivateMethods in estree #11973

Merged
merged 2 commits into from Aug 18, 2020

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Aug 17, 2020

Q                       A
Fixed Issues? Fixes #11972
Patch: Bug Fix? Yes
Tests Added + Pass? Yes
License MIT

Use MethodDefinition as the visitorKeys of ClassPrivateMethods. This should be considered as a ad-hoc fixes before the class features support is landed.

@JLHwung JLHwung added PR: Bug Fix 🐛 A type of pull request used for our changelog categories pkg: parser area: estree labels Aug 17, 2020
@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 17, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ce0451c:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@babel-bot
Copy link
Collaborator

babel-bot commented Aug 17, 2020

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

@mdjermanovic
Copy link

This change might break ESLint's code path analysis, and probably some other places where it is assumed that onlyFunctionDeclaration, FunctionExpression, and ArrowFunctionExpression can represent a function.

/* eslint no-unreachable: error */

class C {
  #a() {
    return;
  }
  #b() {} // no-unreachable false positive
}

t.VISITOR_KEYS.ImportExpression = VISITOR_KEYS.ImportExpression;
t.VISITOR_KEYS.Property = VISITOR_KEYS.Property;
t.VISITOR_KEYS.MethodDefinition = VISITOR_KEYS.MethodDefinition;
for (const [type, visitorKey] of Object.entries(conflictTypes)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also refactored a bit to remove boilerplates.

Copy link
Member

Choose a reason for hiding this comment

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

Nice refactor!

@kaicataldo kaicataldo merged commit cdada58 into babel:main Aug 18, 2020
@kaicataldo kaicataldo deleted the fix-11972 branch August 18, 2020 15:18
@piranna
Copy link

piranna commented Aug 18, 2020

Thanks for merging it :-) What's the stimated time to publish the next 7.11.4 version with this fix?

@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 Nov 18, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: estree 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

visitor keys for ClassPrivateMethod type do not match the structure of ClassPrivateMethod nodes
6 participants