Added logic to skip variable declaration transformation

Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues
This commit is contained in:
sanex3339
2020-01-06 20:57:28 +03:00
parent a34fb4544f
commit 4dcff4eb4d
8 changed files with 152 additions and 9 deletions
+6 -5
View File
@@ -7,11 +7,12 @@ import { NO_ADDITIONAL_NODES_PRESET } from '../../src/options/presets/NoCustomNo
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
`
function foo () {
var bar;
if (false)
bar = {baz: 1};
}
(function () {
var a, b;
({a, b} = {a: 1, b: 2});
console.log(a, b);
})();
`,
{
...NO_ADDITIONAL_NODES_PRESET,