mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
Additional test for VariableDeclarationsMergeTransformer
This commit is contained in:
+27
@@ -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', () => {
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
var foo;
|
||||
var bar;
|
||||
var baz;
|
||||
Reference in New Issue
Block a user