js-confuser
js-confuser copied to clipboard
Rename Variables breaks with statement
Config and Small code sample
Config:
{
target: "node",
renameVariables: true
}
Code:
var a = "Incorrect value";
with ({ a: "Correct Value" }) {
console.log(a);
}
// "Correct Value"
Obfuscated Code:
var Tru_whk = "Incorrect value";
with ({ ["a"]: "Correct Value" }) {
console["log"](Tru_whk);
}
// "Incorrect value"
Additional context
Might be easiest to disable renaming fully in with statements or not support it entirely. Since any object can be passed in, theres no way for the obfuscator to know if the name will be shadowed or not.