MichaelXF / js-confuser

JS-Confuser is a JavaScript obfuscation tool to make your programs *impossible* to read.
https://js-confuser.com
MIT License
204 stars 32 forks source link

Anti Tooling breaks Symbols #74

Closed MichaelXF closed 1 year ago

MichaelXF commented 1 year ago

Describe the bug:

Anti Tooling breaks Symbols

Config and Small code sample

Config:

{
  target: "node",
  preset: "low"
}

Code:

var sym1 = Symbol();

sym1;
sym1;

Output:

var sym1=Symbol();+(sym1,sym1)

Error:

(node:32216) UnhandledPromiseRejectionWarning: TypeError: Cannot convert a Symbol value to a number

The Anti Tooling feature combines expressions and chooses a random unary operator (void, typeof, -, !, +, or ~) which can cause errors with symbols. Anti Tooling, which currently has no option to be turned off, should not use unary operators that perform numeric conversions to avoid this error from occuring. The other operators work correctly.

Le0Developer commented 1 year ago

Also experiencing this with BigInt.