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 handling of this
&co in computed keys in arrows transform
#14005
Fix handling of this
&co in computed keys in arrows transform
#14005
Conversation
this
&co in computed keys in arrows transform
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/50027/ |
Function(path: NodePath<t.Function>) { | ||
// Methods will be handled by the Method visit | ||
if (path.isMethod()) return; | ||
// Arrow functions inherit their parent's environment | ||
if (path.isArrowFunctionExpression()) return; | ||
path.skip(); | ||
}, |
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.
Can we remove it and add FunctionDeclaration
and FunctionExpression
to skipKey
?
|
||
// TODO (Babel 8): Don't export this function. | ||
export function skipAllButComputedKey( | ||
path: NodePath<t.Method | t.ClassProperty | t.ClassPrivateProperty>, |
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.
It seems to me that skipAllButComputedKey
is not invoked on ClassPrivateProperty
.
19b5871
to
d27f33d
Compare
I had to extract
environmentVisitor
to a new package to avoid circular deps between@babel/traverse
and@babell/helper-replace-supers
.