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

astring 1.8.5 generates invalid code when `??` is used

znewsham opened this issue · comments

commented

Motivation

astring.generate(acorn.parse('const x = (a && a.b) ?? c'))

Expected behavior

In version 1.8.4 the output is

const x = (a && a.b) ?? c;

Actual behavior

In 1.8.5 the (invalid) output is

const x = a && a.b ?? c;

Thanks for reporting this @znewsham.