mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
This commit is contained in:
@@ -6,6 +6,7 @@ import { JavaScriptObfuscator } from '../../../src/JavaScriptObfuscator';
|
||||
|
||||
import { NO_CUSTOM_NODES_PRESET } from '../../../src/options/presets/NoCustomNodes';
|
||||
|
||||
import { buildLargeCode } from '../../helpers/buildLargeCode';
|
||||
import { getRegExpMatch } from '../../helpers/getRegExpMatch';
|
||||
import { readFileAsString } from '../../helpers/readFileAsString';
|
||||
|
||||
@@ -459,5 +460,40 @@ describe('JavaScriptObfuscator', () => {
|
||||
assert.match(obfuscatedCode, regExp);
|
||||
});
|
||||
});
|
||||
|
||||
describe('3.5k variables', function () {
|
||||
this.timeout(100000);
|
||||
|
||||
const expectedValue: number = 3500;
|
||||
|
||||
let result: number;
|
||||
|
||||
beforeEach(() => {
|
||||
const code: string = buildLargeCode(expectedValue);
|
||||
const obfuscationResult: IObfuscationResult = JavaScriptObfuscator.obfuscate(
|
||||
code,
|
||||
{
|
||||
compact: true,
|
||||
controlFlowFlattening: true,
|
||||
controlFlowFlatteningThreshold: 1,
|
||||
deadCodeInjection: true,
|
||||
deadCodeInjectionThreshold: 1,
|
||||
disableConsoleOutput: false,
|
||||
rotateStringArray: true,
|
||||
stringArray: true,
|
||||
stringArrayEncoding: 'rc4',
|
||||
stringArrayThreshold: 1,
|
||||
unicodeEscapeSequence: false
|
||||
}
|
||||
);
|
||||
|
||||
const obfuscatedCode: string = obfuscationResult.getObfuscatedCode();
|
||||
result = eval(obfuscatedCode);
|
||||
});
|
||||
|
||||
it('should correctly obfuscate 3.5k variables', () => {
|
||||
assert.equal(result, expectedValue);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user