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

Dispatcher breaks specific function scenario #103

Closed MichaelXF closed 11 months ago

MichaelXF commented 12 months ago

Describe the bug:

Dispatcher breaks function with default parameter that is a function expression that references a shadowed variable.

Config and Small code sample

Config:

{
  target: "node",
  dispatcher: true
}

Code:

var X = "Correct Value";

function printX(
  getX = function () {
    return X;
  }
) {
  var X = "Incorrect Value";

  console.log(getX());
}

printX();

Expected behavior

The program should output "Correct Value"

Actual behavior

The program outputs "Incorrect Value"