refactoring

This commit is contained in:
sanex3339
2016-05-31 15:12:39 +03:00
parent 279f55ad2a
commit 627169a7dd
2 changed files with 7 additions and 5 deletions
+3 -2
View File
@@ -30,10 +30,11 @@ class NodeObfuscator {
return `${prefix}${Utils_1.Utils.decToHex(nodeValue)}`;
}
replaceLiteralStringByUnicodeArrayCall(nodeValue) {
let value = Utils_1.Utils.stringToUnicode(nodeValue), unicodeArray = this.nodes.get('unicodeArrayNode').getNodeData(), sameIndex = unicodeArray.indexOf(value), index, hexadecimalIndex;
let value = Utils_1.Utils.stringToUnicode(nodeValue);
let unicodeArray = this.nodes.get('unicodeArrayNode').getNodeData(), sameIndex = unicodeArray.indexOf(value), index, hexadecimalIndex;
if (sameIndex < 0) {
index = unicodeArray.length;
unicodeArray.push(Utils_1.Utils.stringToUnicode(nodeValue));
unicodeArray.push(value);
}
else {
index = sameIndex;
+4 -3
View File
@@ -86,15 +86,16 @@ export abstract class NodeObfuscator implements INodeObfuscator {
* @returns {string}
*/
protected replaceLiteralStringByUnicodeArrayCall (nodeValue: string): string {
let value: string = Utils.stringToUnicode(nodeValue),
unicodeArray: string[] = this.nodes.get('unicodeArrayNode').getNodeData(),
let value: string = Utils.stringToUnicode(nodeValue);
let unicodeArray: string[] = this.nodes.get('unicodeArrayNode').getNodeData(),
sameIndex: number = unicodeArray.indexOf(value),
index: number,
hexadecimalIndex: string;
if (sameIndex < 0) {
index = unicodeArray.length;
unicodeArray.push(Utils.stringToUnicode(nodeValue));
unicodeArray.push(value);
} else {
index = sameIndex;
}