You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a project that uses @babel/parser to do some analysis, and I need to know if a module uses top-level await.
It's not trivial to detect, because you need to check also, for example, in computed keys inside of methods (doing something like what @babel/helper-environment-visitor does, but that requires a full @babel/traverse).
Describe the solution you'd like
Given that we already need to track this info (to know if await is allowed or an error), we might as well expose it.
Describe alternatives you've considered
/
Documentation, Adoption, Migration Strategy
No response
The text was updated successfully, but these errors were encountered:
I thought about something similar the other day, and this can also be used to avoid some traversals of the entire AST, such as transform-async-generator-functions. This is another way besides the order of plugins.
Perhaps we can put them in extra.usedFeatures.
You are right! If we just want to avoid traversing Program, that works too. Because other plugins run after that.
Of course, I personally prefer to avoid it by plugin order.
馃捇
What problem are you trying to solve?
I'm working on a project that uses
@babel/parser
to do some analysis, and I need to know if a module uses top-level await.It's not trivial to detect, because you need to check also, for example, in computed keys inside of methods (doing something like what
@babel/helper-environment-visitor
does, but that requires a full@babel/traverse
).Describe the solution you'd like
Given that we already need to track this info (to know if
await
is allowed or an error), we might as well expose it.Describe alternatives you've considered
/
Documentation, Adoption, Migration Strategy
No response
The text was updated successfully, but these errors were encountered: