This commit is contained in:
sanex3339
2016-06-05 14:12:55 +03:00
parent 19b3fbecf8
commit 1f93de4baa
2 changed files with 2 additions and 2 deletions
@@ -15,7 +15,7 @@ class SelfDefendingUnicodeNode extends Node_1.Node {
appendNode(blockScopeNode) {
let programBodyLength = blockScopeNode.body.length, randomIndex = 0;
if (programBodyLength > 2) {
randomIndex = Utils_1.Utils.getRandomInteger(programBodyLength / 2, programBodyLength);
randomIndex = Utils_1.Utils.getRandomInteger(programBodyLength / 2, programBodyLength - 1);
}
NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), randomIndex);
}
@@ -37,7 +37,7 @@ export class SelfDefendingUnicodeNode extends Node {
randomIndex: number = 0;
if (programBodyLength > 2) {
randomIndex = Utils.getRandomInteger(programBodyLength / 2, programBodyLength);
randomIndex = Utils.getRandomInteger(programBodyLength / 2, programBodyLength - 1);
}
NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), randomIndex);