MichaelXF / js-confuser

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

Minify breaks function.length property #91

Closed MichaelXF closed 1 year ago

MichaelXF commented 1 year ago

Config and Small code sample

Config:

{
  target: "node",
  minify: true
}

Code:

// Input
function myFunction(myParameter){

}

console.log(myFunction.length) // 1

// Output
var myFunction = __p_8381788016(myParameter => {});
console.log(myFunction.length); // 0
function __p_8381788016(arrowFn) {
    return function () {
        return arrowFn(...arguments);
    };
}

Expected behavior

The program should output 1

Actual behavior

The program outputs 0