import { INode } from "../../interfaces/nodes/INode";
import { IOptions } from "../../interfaces/IOptions";
import { TNodeWithBlockStatement } from "../../types/TNodeWithBlockStatement";
import { AppendState } from "../../enums/AppendState";
import { Node } from '../Node';
import { NodeUtils } from "../../NodeUtils";
export class DebugProtectionFunctionCallNode extends Node {
/**
* @type {AppendState}
*/
protected appendState: AppendState = AppendState.BeforeObfuscation;
/**
* @type {string}
*/
private debugProtectionFunctionName: string;
/**
* @param debugProtectionFunctionName
* @param options
*/
constructor (debugProtectionFunctionName: string, options: IOptions) {
super(options);
this.debugProtectionFunctionName = debugProtectionFunctionName;
}
/**
* @param blockScopeNode
*/
public appendNode (blockScopeNode: TNodeWithBlockStatement): void {
NodeUtils.appendNode(blockScopeNode.body, this.getNode());
}
/**
* @returns {INode}
*/
protected getNodeStructure (): INode {
return NodeUtils.convertCodeToStructure(`
${this.debugProtectionFunctionName}();
`);
}
}
|