Explicitly define NodePath.prototype.*#16488
Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/56905 |
| NodePath_family, | ||
| NodePath_comments, | ||
| ); | ||
| Object.assign(NodePath_Final.prototype, { |
There was a problem hiding this comment.
Thanks! Could you declare this object outside of Object.assign, and then use it for NodePathMixins below so that they use the same data source?
const methods = {
findParent: findParent: NodePath_ancestry.findParent,
// ...
}
Object.assign(NodePath_Final.prototype, methods);
type NodePathMixins = Omit<typeof methods, keyof NodePathOverwrites>;| ...(!process.env.BABEL_8_BREAKING && !USE_ESM | ||
| ? { | ||
| arrowFunctionToShadowed: | ||
| // workaround for rollup | ||
| // @ts-expect-error babel 7 only | ||
| NodePath_conversion[String("arrowFunctionToShadowed")], | ||
| } | ||
| : {}), |
There was a problem hiding this comment.
Please keep this in a separate statement, otherwise TS will include its type also in the Babel 8 build.
nicolo-ribaudo
left a comment
There was a problem hiding this comment.
Thanks!
After this, could you open a new PR removing in Babel 8
- all the methods that start in
_ - all the methods that are not used outside of
@babel/traverse?
|
Sure! I'm a little unsure if anyone is using methods starting with |
|
Well |
|
Could you rebase this on top of |
6a98195 to
7846fca
Compare
|
The CI failure is from node v22.2.0. Ref: nodejs/node#52827 Reported in nodejs/node#53011 |
path.prototype.*NodePath.prototype.*
Uh oh!
There was an error while loading. Please reload this page.