More stable way to preserve identifiers with scope identifiers traverser

This commit is contained in:
sanex3339
2020-02-13 01:57:36 +03:00
parent eb233be65a
commit 89e8a2452a
21 changed files with 3982 additions and 154 deletions
+5 -11
View File
@@ -7,22 +7,16 @@ import { NO_ADDITIONAL_NODES_PRESET } from '../../src/options/presets/NoCustomNo
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
`
function a (a, b) {
}
function b (b, c) {
}
const b = function () {}
// javascript-obfuscator:disable
function a () {}
// javascript-obfuscator:enable
`,
{
...NO_ADDITIONAL_NODES_PRESET,
compact: false,
identifierNamesGenerator: 'mangled',
identifiersPrefix: 'a',
transformObjectKeys: true,
stringArray: true,
stringArrayThreshold: 1,
log: true
}
).getObfuscatedCode();