Closed j4k0xb closed 1 year ago
Thanks for reporting this, @j4k0xb! Mind trying #1361 to see if that fixes it for you?
yes that fixed it, thanks!
a bit related but parsing (-1) ** 2
also fails
recast.parse('(-1) ** 2', { parser: acorn })
only allows es6 syntax, any idea why?
https://github.com/benjamn/recast/blob/2bb3a4ffddf038138fefa8c49158ffcfe14515ea/lib/parser.ts#L32I'm not sure why it's hardcoded to ecmaVersion: 6
. I'm guessing it was added when that was the latest standard.
reproduction: https://stackblitz.com/edit/stackblitz-starters-9gkcmv?file=index.js&view=editor
it prints
-1 ** 2
which is invalid syntax:expected:
(-1) ** 2
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence#table 2.
related but not fixed by #363