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

Missing parentheses in LogicalExpression

pablobfonseca opened this issue · comments

Motivation

SyntaxError: Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses (1:14)

Expected behavior

It should keep the parentheses.

Actual behavior

The following code:

(false || true) ?? !1

is being transformed without parentheses, and throwing a SyntaxError

Thanks @pablobfonseca for reporting this, should be fixed shortly.