mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
Improved rename of deadCodeInjection dead code identifiers. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/708
This commit is contained in:
+27
-6
@@ -7,17 +7,38 @@ import { NO_ADDITIONAL_NODES_PRESET } from '../../src/options/presets/NoCustomNo
|
||||
|
||||
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
|
||||
`
|
||||
const foo = {
|
||||
bar: {
|
||||
baz: 1
|
||||
function foo () {
|
||||
function bar () {
|
||||
const a = [];
|
||||
const b = [];
|
||||
while (true) {
|
||||
for (const a of b) {}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
};
|
||||
|
||||
console.log(foo.bar.baz);
|
||||
function baz () {
|
||||
const a = 1;
|
||||
}
|
||||
|
||||
function bark () {
|
||||
const a = 1;
|
||||
|
||||
if (true) {
|
||||
console.log(a);
|
||||
}
|
||||
}
|
||||
|
||||
function hawk () {
|
||||
const a = 1;
|
||||
}
|
||||
}
|
||||
`,
|
||||
{
|
||||
...NO_ADDITIONAL_NODES_PRESET,
|
||||
compact: false
|
||||
compact: false,
|
||||
deadCodeInjection: true,
|
||||
deadCodeInjectionThreshold: 1
|
||||
}
|
||||
).getObfuscatedCode();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user