Added console.table empty function to ConsoleOutputDisableExpressionTemplate

This commit is contained in:
sanex3339
2020-01-06 18:33:57 +03:00
parent 9927fdc63c
commit 7e8f67992c
6 changed files with 11 additions and 3 deletions
+1
View File
@@ -5,6 +5,7 @@ v0.21.0
* Improved `transformObjectKeys` transformation to cover more cases
* Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/406
* Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/387
* Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/333
v0.20.4
---
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
@@ -18,6 +18,7 @@ export function ConsoleOutputDisableExpressionTemplate (): string {
c.info = func;
c.error = func;
c.exception = func;
c.table = func;
c.trace = func;
return c;
@@ -29,6 +30,7 @@ export function ConsoleOutputDisableExpressionTemplate (): string {
that.console.info = func;
that.console.error = func;
that.console.exception = func;
that.console.table = func;
that.console.trace = func;
}
});
@@ -10,6 +10,7 @@ describe('ConsoleOutputDisableExpressionNode', () => {
const consoleLogRegExp: RegExp = /_0x([a-f0-9]){4,6}\['console'\]\['log'\] *= *_0x([a-f0-9]){4,6};/u;
const consoleErrorRegExp: RegExp = /_0x([a-f0-9]){4,6}\['console'\]\['error'\] *= *_0x([a-f0-9]){4,6};/u;
const consoleWarnRegExp: RegExp = /_0x([a-f0-9]){4,6}\['console'\]\['warn'\] *= *_0x([a-f0-9]){4,6};/u;
const consoleTableRegExp: RegExp = /_0x([a-f0-9]){4,6}\['console'\]\['table'\] *= *_0x([a-f0-9]){4,6};/u;
describe('`disableConsoleOutput` option is set', () => {
let obfuscatedCode: string;
@@ -37,6 +38,10 @@ describe('ConsoleOutputDisableExpressionNode', () => {
it('match #3: should correctly append custom node into the obfuscated code', () => {
assert.match(obfuscatedCode, consoleWarnRegExp);
});
it('match #4: should correctly append custom node into the obfuscated code', () => {
assert.match(obfuscatedCode, consoleTableRegExp);
});
});
describe('`disableConsoleOutput` option isn\'t set', () => {