* Fixed identifier names generations for mangled and dictionary identifier names generators

* Fixed combination of `identifierNamesGenerator: dictionary` and `debugProtection` options
* `seed` option now accepts `string` and `number` values
This commit is contained in:
sanex3339
2020-01-01 21:46:51 +03:00
parent f39d16370b
commit 945e885240
26 changed files with 304 additions and 22895 deletions
@@ -570,7 +570,7 @@ describe('JavaScriptObfuscator', () => {
});
describe('dictionary identifier names generator', () => {
const regExp: RegExp = /var *[ab] *= *0x1; *var *[ab] *= *0x2; *var *[AB] *= *0x3;/;
const regExp: RegExp = /var *[abc] *= *0x1; *var *[ABC] *= *0x2; *var *[ABC] *= *0x3;/;
let obfuscatedCode: string;
@@ -582,7 +582,7 @@ describe('JavaScriptObfuscator', () => {
{
...NO_ADDITIONAL_NODES_PRESET,
identifierNamesGenerator: IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator,
identifiersDictionary: ['a', 'b']
identifiersDictionary: ['a', 'b', 'c']
}
).getObfuscatedCode();
});
@@ -667,7 +667,7 @@ describe('JavaScriptObfuscator', () => {
});
});
describe('Identifier names collision between base code and appended custom nodes', () => {
describe('Identifier names collision between base code and appended string array nodes', () => {
const samplesCount: number = 30;
let areCollisionsExists: boolean = false;