mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
Fix error when ClassExpression is the CallExpression callee (#1336)
This commit is contained in:
@@ -1049,6 +1049,28 @@ describe('JavaScriptObfuscator', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// https://github.com/javascript-obfuscator/javascript-obfuscator/issues/1132
|
||||
describe('CallExpression ClassExpression crash fix', () => {
|
||||
const regExp: RegExp = /try *\{!class *\{} *\(\);} *catch *\{}/;
|
||||
|
||||
let obfuscatedCode: string;
|
||||
|
||||
beforeEach(() => {
|
||||
const code: string = readFileAsString(__dirname + '/fixtures/call-expression-class-expression.js');
|
||||
|
||||
obfuscatedCode = JavaScriptObfuscator.obfuscate(
|
||||
code,
|
||||
{
|
||||
...NO_ADDITIONAL_NODES_PRESET
|
||||
}
|
||||
).getObfuscatedCode();
|
||||
});
|
||||
|
||||
it('should not throw', () => {
|
||||
assert.match(obfuscatedCode, regExp);
|
||||
});
|
||||
});
|
||||
|
||||
describe('mangled identifier names generator', () => {
|
||||
const regExp: RegExp = /var c *= *0x1/;
|
||||
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
try { ! class { } ( ) ; } catch { }
|
||||
Reference in New Issue
Block a user