trullock / NUglify

NUglify is a HTML, JavaScript and CSS minification Library for .NET (fork of AjaxMin + new features)
Other
396 stars 79 forks source link

Invalid yield after JS minification #300

Closed jbress closed 2 years ago

jbress commented 2 years ago

Hello,

This if (!(yield isOk(p * n))) { ... }

Becomes this if (!yield t(n * r)) { ... }

which is not valid (throws "Unexpected identifier" error)

Expecting if (!(yield t(n * r))) { ... }

The input javascript code is transpiled via TypeScript 4.3 with ES2015 target (Visual Studio 2019) Full code attached 1 input.js.txt 2 output actual.js.txt 3 output expected.js.txt source.ts.txt

trullock commented 2 years ago

Thanks for the report, will take a look

jbress commented 2 years ago

Great. Thanks for this project btw

Note that I could only reproduce the problem when combining if-not with for-loop.

Meanwhile, is there any setting/workaround to "disable" the removal of the parentheses ?

trullock commented 2 years ago

Fixed in 1.17.11

jbress commented 2 years ago

Thank you !