|
@@ -4,11 +4,11 @@ const AppendState_1 = require("../../enums/AppendState");
|
|
|
const Node_1 = require('../Node');
|
|
|
const NodeUtils_1 = require("../../NodeUtils");
|
|
|
const Utils_1 = require("../../Utils");
|
|
|
-class UnicodeArrayTranslator extends Node_1.Node {
|
|
|
- constructor(unicodeArrayTranslatorName, unicodeArrayName, unicodeArray) {
|
|
|
+class UnicodeArrayCallsWrapper extends Node_1.Node {
|
|
|
+ constructor(unicodeArrayCallsWrapperName, unicodeArrayName, unicodeArray) {
|
|
|
super();
|
|
|
this.appendState = AppendState_1.AppendState.AfterObfuscation;
|
|
|
- this.unicodeArrayTranslatorName = unicodeArrayTranslatorName;
|
|
|
+ this.unicodeArrayCallsWrapperName = unicodeArrayCallsWrapperName;
|
|
|
this.unicodeArrayName = unicodeArrayName;
|
|
|
this.unicodeArray = unicodeArray;
|
|
|
this.node = this.getNodeStructure();
|
|
@@ -17,7 +17,7 @@ class UnicodeArrayTranslator extends Node_1.Node {
|
|
|
NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
|
|
|
}
|
|
|
getNodeIdentifier() {
|
|
|
- return this.unicodeArrayTranslatorName;
|
|
|
+ return this.unicodeArrayCallsWrapperName;
|
|
|
}
|
|
|
;
|
|
|
getNode() {
|
|
@@ -28,7 +28,7 @@ class UnicodeArrayTranslator extends Node_1.Node {
|
|
|
}
|
|
|
getNodeStructure() {
|
|
|
let keyName = Utils_1.Utils.getRandomVariableName(), node = esprima.parse(`
|
|
|
- var ${this.unicodeArrayTranslatorName} = function (${keyName}) {
|
|
|
+ var ${this.unicodeArrayCallsWrapperName} = function (${keyName}) {
|
|
|
return ${this.unicodeArrayName}[[][${Utils_1.Utils.stringToUnicode('filter')}][${Utils_1.Utils.stringToUnicode('constructor')}](${Utils_1.Utils.stringToUnicode('return this')})()[${Utils_1.Utils.stringToUnicode('parseInt')}](${keyName})]
|
|
|
};
|
|
|
`);
|
|
@@ -36,4 +36,4 @@ class UnicodeArrayTranslator extends Node_1.Node {
|
|
|
return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(node);
|
|
|
}
|
|
|
}
|
|
|
-exports.UnicodeArrayTranslator = UnicodeArrayTranslator;
|
|
|
+exports.UnicodeArrayCallsWrapper = UnicodeArrayCallsWrapper;
|