HookyQR / VSCodeMinify

Add minify function to VSCode 0.10+
53 stars 20 forks source link

Nullish Colaescing Operator ?? causes an error #68

Open xavi-mat opened 1 year ago

xavi-mat commented 1 year ago

It seems that Minify can't manage the nullish coalescing operator. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator

I'm trying to minimize this:

const a = document.nonExistent ?? "Not found";

And get:

Minify failed: Unexpected token: operator (?)

Am I missing something?

flan6 commented 3 weeks ago

Can confirm this also happens with something?.something syntax. The ? causes the next token to be unexpected

lyc0930 commented 2 weeks ago

Yes, It also can be confirmed that optional chaining ?. causes an "unexpected punc(.)" error.