mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
Add prefix only for variables with global declaration
This commit is contained in:
+5
-6
@@ -6,19 +6,18 @@ import { NO_ADDITIONAL_NODES_PRESET } from '../../src/options/presets/NoCustomNo
|
||||
|
||||
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
|
||||
`
|
||||
var bar = 1;
|
||||
var baz = 2;
|
||||
(function(){
|
||||
function foo () {
|
||||
eval('var s = 1;');
|
||||
}
|
||||
|
||||
foo();
|
||||
var bark = bar + baz;
|
||||
})();
|
||||
`,
|
||||
{
|
||||
...NO_ADDITIONAL_NODES_PRESET,
|
||||
compact: false,
|
||||
identifiersPrefix: 'foo',
|
||||
identifierNamesGenerator: 'mangled'
|
||||
identifierNamesGenerator: 'mangled',
|
||||
renameGlobals: true
|
||||
}
|
||||
).getObfuscatedCode();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user