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
Conversation
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:
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/27532/ |
This change might break ESLint's code path analysis, and probably some other places where it is assumed that only /* 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)) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice refactor!
Thanks for merging it :-) What's the stimated time to publish the next 7.11.4 version with this fix? |
Use
MethodDefinition
as the visitorKeys ofClassPrivateMethods
. This should be considered as a ad-hoc fixes before the class features support is landed.