Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Open
Description
What code were you trying to parse?
/**@type {Date} */(expr)
What did you expect to happen?
There are cases when AST consumers need to know whether an expression had parens. Babel adds.extra.parenthesized: true
to nodes. My proposal is to do the same thing. For example, this feature would be useful for Prettier to formatClosure-style type casts properly.
What actually happened?
The parser ignores parens when building the AST.
Versions
not relevant