Files
javascript-obfuscator-javas…/src/node-groups/DebugProtectionNodesGroup.ts
T
2016-06-11 12:43:14 +03:00

39 lines
1.4 KiB
TypeScript

import { IOptions } from "../interfaces/IOptions";
import { DebugProtectionFunctionCallNode } from "../custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode";
import { DebugProtectionFunctionIntervalNode } from "../custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode";
import { DebugProtectionFunctionNode } from "../custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode";
import { NodesGroup } from './NodesGroup';
import { Utils } from '../Utils';
export class DebugProtectionNodesGroup extends NodesGroup {
/**
* @type {string}
*/
private debugProtectionFunctionIdentifier: string = Utils.getRandomVariableName();
/**
* @param options
*/
constructor (options: IOptions) {
super(options);
this.nodes.set(
'debugProtectionFunctionNode',
new DebugProtectionFunctionNode(this.debugProtectionFunctionIdentifier, this.options)
);
this.nodes.set(
'debugProtectionFunctionCallNode',
new DebugProtectionFunctionCallNode(this.debugProtectionFunctionIdentifier, this.options)
);
if (this.options.getOption('debugProtectionInterval')) {
this.nodes.set(
'debugProtectionFunctionIntervalNode',
new DebugProtectionFunctionIntervalNode(this.debugProtectionFunctionIdentifier, this.options)
);
}
}
}