davidbonnet / astring

🌳 Tiny and fast JavaScript code generator from an ESTree-compliant AST.

Home Page:https://david.bonnet.cc/astring/demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with preserving parenthesis

Lookout-ent opened this issue · comments

Parenthesis is not preserved in case of logical expression
I'm using acorn for parsing.
Ex: const v = (e ?? null) && f.createElement() is getting reduced to const v = e ?? null && f.createElement()

I checked the code. apparently issue seems to be with precedence
?? should have lower precedence than &&
not sure if there are more bugs related to parenthesis preserving

I also wanted to know what's the long term support plan for astring ?
i see last release was in dec 2021.
are we planning to maintain it for future ecma releases ?

Thanks @Lookout-ent for reporting this.

I also wanted to know what's the long term support plan for astring ?

Astring is being used in production on several projects and is maintained to follow spec updates.

i see last release was in dec 2021.

There have been more recent tags published to NPM since.