Fixed stringArrayWrappersCount behaviour with arrow function scope without statements

This commit is contained in:
sanex
2020-09-12 13:59:07 +03:00
parent 78383e7cb3
commit 09e89f8fe6
13 changed files with 121 additions and 57 deletions
+4 -29
View File
@@ -8,42 +8,17 @@ import { IdentifierNamesGenerator } from '../../src/enums/generators/identifier-
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
`
const foo = 'aaa';
function test (a, b) {
const bar = 'bbb';
function test1 (a, b) {
const baz = 'ccc';
function test2 (a, b) {
const bark = 'ddd';
return bark;
}
return baz + test2();
}
return bar + test1();
}
function test3 (a, b) {
const hawk = 'eee';
return hawk;
}
foo + test() + test3();
[].map(v => 'vvv');
`,
{
...NO_ADDITIONAL_NODES_PRESET,
compact: false,
identifierNamesGenerator: IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,
identifierNamesGenerator: IdentifierNamesGenerator.MangledIdentifierNamesGenerator,
renameGlobals: true,
stringArray: true,
transformObjectKeys: true,
stringArrayThreshold: 1,
stringArrayWrappersChainedCalls: true,
stringArrayWrappersChainedCalls: false,
stringArrayWrappersCount: 1
}
).getObfuscatedCode();