mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
decrease threshold for StackTraceAnalyzer
This commit is contained in:
@@ -70,7 +70,7 @@ if (!(<any>global)._babelPolyfill) {
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
`).repeat(200)}
|
||||
`).repeat(1000)}
|
||||
|
||||
console.log = log;
|
||||
console.log(new Date() - start);
|
||||
|
||||
@@ -7,17 +7,15 @@ const assert: any = chai.assert;
|
||||
describe('StackTraceAnalyzer', () => {
|
||||
describe('getLimitIndex (blockScopeBodyLength: number): number', () => {
|
||||
it('should returns correct limit index based on block scope body length', () => {
|
||||
const blockScopeBodyLength1: number = 100;
|
||||
const blockScopeBodyLength2: number = 22;
|
||||
const blockScopeBodyLength3: number = 26;
|
||||
const blockScopeBodyLength4: number = 28;
|
||||
const blockScopeBodyLength5: number = 34;
|
||||
const blockScopeBodyLength1: number = 10000;
|
||||
const blockScopeBodyLength2: number = 1000;
|
||||
const blockScopeBodyLength3: number = 25;
|
||||
const blockScopeBodyLength4: number = 5;
|
||||
|
||||
assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength1), 34);
|
||||
assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength2), 21);
|
||||
assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength3), 25);
|
||||
assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength4), 27);
|
||||
assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength5), 27);
|
||||
assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength1), 44);
|
||||
assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength2), 26);
|
||||
assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength3), 24);
|
||||
assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength4), 4);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user