mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
* Fixed combination of `identifierNamesGenerator: dictionary` and `debugProtection` options * `seed` option now accepts `string` and `number` values
22 lines
717 B
TypeScript
22 lines
717 B
TypeScript
/**
|
|
* @returns {string}
|
|
*/
|
|
export function DebugProtectionFunctionCallTemplate (): string {
|
|
return `
|
|
(function () {
|
|
{singleNodeCallControllerFunctionName}(this, function () {
|
|
var regExp1 = new RegExp('function *\\\\( *\\\\)');
|
|
var regExp2 = new RegExp('\\\\+\\\\+ *\\(?:[a-zA-Z_$][0-9a-zA-Z_$]*\\)', 'i');
|
|
|
|
var result = {debugProtectionFunctionName}('init');
|
|
|
|
if (!regExp1.test(result + 'chain') || !regExp2.test(result + 'input')) {
|
|
result('0');
|
|
} else {
|
|
{debugProtectionFunctionName}();
|
|
}
|
|
})();
|
|
})();
|
|
`;
|
|
}
|