js-confuser
js-confuser copied to clipboard
invalid generated js for `(a ?? {}) && ""`
Describe the bug:
Compiles invalid JS
Config and Small code sample
Config:
{
target: "node",
preset: "high"
}
Code:
(a ?? {}) && ""
Expected behavior
Compiles to (a??{})&&''
Actual behavior
Compiles to a??{}&&'' which is invalid.
I believe this error has to do with escodegen or acorn, not with the obfuscator itself. I don't know how to fix this.
Fixed in 2.0 (Currently 2.0.0-alpha.2). The 2.0 version nows uses Babel's parser and generator and is more suited for modern JavaScript syntax.