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 format Closure-style type casts properly.
What actually happened?
The parser ignores parens when building the AST.
Versions
not relevant