mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
49 lines
1.2 KiB
TypeScript
49 lines
1.2 KiB
TypeScript
import { BlockScopeNode } from "../../types/BlockScopeNode";
|
|
|
|
import { NodeType } from "../../enums/NodeType";
|
|
|
|
import { Node } from '../Node';
|
|
import { NodeUtils } from "../../NodeUtils";
|
|
|
|
export class DebugProtectionFunctionCallNode extends Node {
|
|
/**
|
|
* @type {string}
|
|
*/
|
|
private debugProtectionFunctionName: string;
|
|
|
|
/**
|
|
* @param debugProtectionFunctionName
|
|
*/
|
|
constructor (debugProtectionFunctionName: string) {
|
|
super();
|
|
|
|
this.debugProtectionFunctionName = debugProtectionFunctionName;
|
|
|
|
this.node = this.getNodeStructure();
|
|
}
|
|
|
|
/**
|
|
* @param blockScopeNode
|
|
*/
|
|
public appendNode (blockScopeNode: BlockScopeNode): void {
|
|
NodeUtils.appendNode(blockScopeNode.body, this.getNode());
|
|
}
|
|
|
|
/**
|
|
* @returns any
|
|
*/
|
|
protected getNodeStructure (): any {
|
|
return {
|
|
'type': NodeType.ExpressionStatement,
|
|
'expression': {
|
|
'type': NodeType.CallExpression,
|
|
'callee': {
|
|
'type': NodeType.Identifier,
|
|
'name': this.debugProtectionFunctionName
|
|
},
|
|
'arguments': []
|
|
}
|
|
};
|
|
}
|
|
}
|