This commit is contained in:
sanex3339
2016-05-24 21:04:44 +03:00
parent 7af21ad3c3
commit 12c6ccb1d1
3 changed files with 7 additions and 3 deletions
@@ -30,7 +30,7 @@ export class DebugProtectionFunctionNode extends Node {
*/
public appendNode (blockScopeNode: BlockScopeNode): void {
let programBodyLength: number = blockScopeNode.body.length,
randomIndex = Utils.getRandomInteger(0, programBodyLength);
randomIndex: number = Utils.getRandomInteger(0, programBodyLength);
NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), randomIndex);
}
@@ -14,7 +14,8 @@ class UnicodeArrayRotateFunctionNode extends Node_1.Node {
this.node = this.getNodeStructure();
}
appendNode(blockScopeNode) {
NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
let programBodyLength = blockScopeNode.body.length, randomIndex = Utils_1.Utils.getRandomInteger(1, programBodyLength);
NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), randomIndex);
}
getNode() {
if (!this.unicodeArray.length) {
@@ -55,7 +55,10 @@ export class UnicodeArrayRotateFunctionNode extends Node {
* @param blockScopeNode
*/
public appendNode (blockScopeNode: BlockScopeNode): void {
NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
let programBodyLength: number = blockScopeNode.body.length,
randomIndex: number = Utils.getRandomInteger(1, programBodyLength);
NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), randomIndex);
}
/**