Additional test for VariableDeclarationsMergeTransformer

This commit is contained in:
sanex3339
2020-06-26 17:21:14 +03:00
parent 87aca85f3e
commit 866c132f79
4 changed files with 32 additions and 2 deletions
+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
@@ -114,6 +114,33 @@ describe('VariableDeclarationsMergeTransformer', () => {
assert.match(obfuscatedCode, regExp);
});
});
describe('Variant #5: multiple variable declarations without declarators', () => {
const regExp: RegExp = new RegExp(
'var foo, *' +
'bar, *' +
'baz;'
);
let obfuscatedCode: string;
before(() => {
const code: string = readFileAsString(__dirname + '/fixtures/multiple-declarations-without-declarators.js');
obfuscatedCode = JavaScriptObfuscator.obfuscate(
code,
{
...NO_ADDITIONAL_NODES_PRESET,
minify: true
}
).getObfuscatedCode();
});
it('should merge variable declarations', () => {
assert.match(obfuscatedCode, regExp);
});
});
});
describe('object pattern as initializer', () => {