Kaynağa Gözat

es6 to es5 with babel compilation

sanex3339 9 yıl önce
ebeveyn
işleme
c93ff0dd41
37 değiştirilmiş dosya ile 1960 ekleme ve 1139 silme
  1. 3 0
      .babelrc
  2. 2 1
      dist/index.js
  3. 39 19
      dist/src/JavaScriptObfuscator.js
  4. 144 97
      dist/src/NodeUtils.js
  5. 112 90
      dist/src/Obfuscator.js
  6. 45 23
      dist/src/OptionsNormalizer.js
  7. 101 64
      dist/src/Utils.js
  8. 53 18
      dist/src/custom-nodes/Node.js
  9. 68 26
      dist/src/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.js
  10. 73 24
      dist/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.js
  11. 85 41
      dist/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.js
  12. 50 36
      dist/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.js
  13. 80 33
      dist/src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.js
  14. 66 37
      dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayCallsWrapper.js
  15. 70 75
      dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.js
  16. 82 46
      dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayNode.js
  17. 70 51
      dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode.js
  18. 1 0
      dist/src/enums/AppendState.js
  19. 12 11
      dist/src/enums/JSFuck.js
  20. 2 1
      dist/src/enums/NodeType.js
  21. 33 14
      dist/src/node-groups/DebugProtectionNodesGroup.js
  22. 34 6
      dist/src/node-groups/NodesGroup.js
  23. 26 7
      dist/src/node-groups/SelfDefendingNodesGroup.js
  24. 55 21
      dist/src/node-groups/UnicodeArrayNodesGroup.js
  25. 68 31
      dist/src/node-obfuscators/CatchClauseObfuscator.js
  26. 72 35
      dist/src/node-obfuscators/FunctionDeclarationObfuscator.js
  27. 68 31
      dist/src/node-obfuscators/FunctionObfuscator.js
  28. 55 29
      dist/src/node-obfuscators/LiteralObfuscator.js
  29. 80 47
      dist/src/node-obfuscators/MemberExpressionObfuscator.js
  30. 56 25
      dist/src/node-obfuscators/MethodDefinitionObfuscator.js
  31. 82 53
      dist/src/node-obfuscators/NodeObfuscator.js
  32. 79 46
      dist/src/node-obfuscators/ObjectExpressionObfuscator.js
  33. 87 54
      dist/src/node-obfuscators/VariableDeclarationObfuscator.js
  34. 1 0
      dist/src/preset-options/DefaultPreset.js
  35. 1 0
      dist/src/preset-options/NoCustomNodesPreset.js
  36. 2 47
      dist/tests/dev-test.js
  37. 3 0
      package.json

+ 3 - 0
.babelrc

@@ -0,0 +1,3 @@
+{
+  "presets": ["es2015"]
+}

+ 2 - 1
dist/index.js

@@ -1,3 +1,4 @@
 "use strict";
-const JavaScriptObfuscator_1 = require('./src/JavaScriptObfuscator');
+
+var JavaScriptObfuscator_1 = require('./src/JavaScriptObfuscator');
 module.exports = JavaScriptObfuscator_1.JavaScriptObfuscator;

+ 39 - 19
dist/src/JavaScriptObfuscator.js

@@ -1,25 +1,45 @@
 "use strict";
-const esprima = require('esprima');
-const escodegen = require('escodegen');
-const DefaultPreset_1 = require('./preset-options/DefaultPreset');
-const Obfuscator_1 = require('./Obfuscator');
-const OptionsNormalizer_1 = require("./OptionsNormalizer");
-class JavaScriptObfuscator {
-    static obfuscate(sourceCode, customOptions) {
-        let astTree = esprima.parse(sourceCode), options = OptionsNormalizer_1.OptionsNormalizer.normalize(Object.assign({}, DefaultPreset_1.DEFAULT_PRESET, customOptions)), obfuscator = new Obfuscator_1.Obfuscator(options);
-        astTree = obfuscator.obfuscateNode(astTree);
-        return JavaScriptObfuscator.generateCode(astTree, options);
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var esprima = require('esprima');
+var escodegen = require('escodegen');
+var DefaultPreset_1 = require('./preset-options/DefaultPreset');
+var Obfuscator_1 = require('./Obfuscator');
+var OptionsNormalizer_1 = require("./OptionsNormalizer");
+
+var JavaScriptObfuscator = function () {
+    function JavaScriptObfuscator() {
+        _classCallCheck(this, JavaScriptObfuscator);
     }
-    static generateCode(astTree, options) {
-        let escodegenParams = Object.assign({}, JavaScriptObfuscator.escodegenParams);
-        if (options.hasOwnProperty('compact')) {
-            escodegenParams.format = {
-                compact: options.compact
-            };
+
+    _createClass(JavaScriptObfuscator, null, [{
+        key: 'obfuscate',
+        value: function obfuscate(sourceCode, customOptions) {
+            var astTree = esprima.parse(sourceCode),
+                options = OptionsNormalizer_1.OptionsNormalizer.normalize(Object.assign({}, DefaultPreset_1.DEFAULT_PRESET, customOptions)),
+                obfuscator = new Obfuscator_1.Obfuscator(options);
+            astTree = obfuscator.obfuscateNode(astTree);
+            return JavaScriptObfuscator.generateCode(astTree, options);
         }
-        return escodegen.generate(astTree, escodegenParams);
-    }
-}
+    }, {
+        key: 'generateCode',
+        value: function generateCode(astTree, options) {
+            var escodegenParams = Object.assign({}, JavaScriptObfuscator.escodegenParams);
+            if (options.hasOwnProperty('compact')) {
+                escodegenParams.format = {
+                    compact: options.compact
+                };
+            }
+            return escodegen.generate(astTree, escodegenParams);
+        }
+    }]);
+
+    return JavaScriptObfuscator;
+}();
+
 JavaScriptObfuscator.escodegenParams = {
     verbatim: 'x-verbatim-property'
 };

+ 144 - 97
dist/src/NodeUtils.js

@@ -1,111 +1,158 @@
 "use strict";
-const estraverse = require('estraverse');
-const NodeType_1 = require("./enums/NodeType");
-const Utils_1 = require("./Utils");
-class NodeUtils {
-    static addXVerbatimPropertyToLiterals(node) {
-        estraverse.replace(node, {
-            enter: (node, parentNode) => {
-                if (NodeUtils.isLiteralNode(node)) {
-                    node['x-verbatim-property'] = node.raw;
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var estraverse = require('estraverse');
+var NodeType_1 = require("./enums/NodeType");
+var Utils_1 = require("./Utils");
+
+var NodeUtils = function () {
+    function NodeUtils() {
+        _classCallCheck(this, NodeUtils);
+    }
+
+    _createClass(NodeUtils, null, [{
+        key: "addXVerbatimPropertyToLiterals",
+        value: function addXVerbatimPropertyToLiterals(node) {
+            estraverse.replace(node, {
+                enter: function enter(node, parentNode) {
+                    if (NodeUtils.isLiteralNode(node)) {
+                        node['x-verbatim-property'] = node.raw;
+                    }
                 }
+            });
+        }
+    }, {
+        key: "appendNode",
+        value: function appendNode(blockScopeBody, node) {
+            if (!NodeUtils.validateNode(node)) {
+                return;
             }
-        });
-    }
-    static appendNode(blockScopeBody, node) {
-        if (!NodeUtils.validateNode(node)) {
-            return;
+            blockScopeBody.push(node);
         }
-        blockScopeBody.push(node);
-    }
-    static getBlockScopeNodeByIndex(node, index = 0) {
-        if (NodeUtils.isNodeHasBlockScope(node) && node.body[index]) {
-            return node.body[index];
+    }, {
+        key: "getBlockScopeNodeByIndex",
+        value: function getBlockScopeNodeByIndex(node) {
+            var index = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];
+
+            if (NodeUtils.isNodeHasBlockScope(node) && node.body[index]) {
+                return node.body[index];
+            }
+            return node;
         }
-        return node;
-    }
-    static getBlockScopeOfNode(node, depth = 0) {
-        if (!node.parentNode) {
-            throw new ReferenceError('`parentNode` property of given node is `undefined`');
+    }, {
+        key: "getBlockScopeOfNode",
+        value: function getBlockScopeOfNode(node) {
+            var depth = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];
+
+            if (!node.parentNode) {
+                throw new ReferenceError('`parentNode` property of given node is `undefined`');
+            }
+            if (node.parentNode.type === NodeType_1.NodeType.Program) {
+                return node.parentNode;
+            }
+            if (!Utils_1.Utils.arrayContains(NodeUtils.scopeNodes, node.parentNode.type)) {
+                return NodeUtils.getBlockScopeOfNode(node.parentNode, depth);
+            }
+            if (depth > 0) {
+                return NodeUtils.getBlockScopeOfNode(node.parentNode, --depth);
+            }
+            if (node.type !== NodeType_1.NodeType.BlockStatement) {
+                return NodeUtils.getBlockScopeOfNode(node.parentNode);
+            }
+            return node;
         }
-        if (node.parentNode.type === NodeType_1.NodeType.Program) {
-            return node.parentNode;
+    }, {
+        key: "getProgramNode",
+        value: function getProgramNode(bodyNode) {
+            return {
+                'type': NodeType_1.NodeType.Program,
+                'body': bodyNode
+            };
         }
-        if (!Utils_1.Utils.arrayContains(NodeUtils.scopeNodes, node.parentNode.type)) {
-            return NodeUtils.getBlockScopeOfNode(node.parentNode, depth);
+    }, {
+        key: "insertNodeAtIndex",
+        value: function insertNodeAtIndex(blockScopeBody, node, index) {
+            if (!NodeUtils.validateNode(node)) {
+                return;
+            }
+            blockScopeBody.splice(index, 0, node);
         }
-        if (depth > 0) {
-            return NodeUtils.getBlockScopeOfNode(node.parentNode, --depth);
+    }, {
+        key: "isBlockStatementNode",
+        value: function isBlockStatementNode(node) {
+            return node.type === NodeType_1.NodeType.BlockStatement;
         }
-        if (node.type !== NodeType_1.NodeType.BlockStatement) {
-            return NodeUtils.getBlockScopeOfNode(node.parentNode);
+    }, {
+        key: "isIdentifierNode",
+        value: function isIdentifierNode(node) {
+            return node.type === NodeType_1.NodeType.Identifier;
         }
-        return node;
-    }
-    static getProgramNode(bodyNode) {
-        return {
-            'type': NodeType_1.NodeType.Program,
-            'body': bodyNode
-        };
-    }
-    static insertNodeAtIndex(blockScopeBody, node, index) {
-        if (!NodeUtils.validateNode(node)) {
-            return;
+    }, {
+        key: "isLiteralNode",
+        value: function isLiteralNode(node) {
+            return node.type === NodeType_1.NodeType.Literal;
         }
-        blockScopeBody.splice(index, 0, node);
-    }
-    static isBlockStatementNode(node) {
-        return node.type === NodeType_1.NodeType.BlockStatement;
-    }
-    static isIdentifierNode(node) {
-        return node.type === NodeType_1.NodeType.Identifier;
-    }
-    static isLiteralNode(node) {
-        return node.type === NodeType_1.NodeType.Literal;
-    }
-    static isMemberExpressionNode(node) {
-        return node.type === NodeType_1.NodeType.MemberExpression;
-    }
-    static isNodeHasBlockScope(node) {
-        return node.hasOwnProperty('body');
-    }
-    static isProgramNode(node) {
-        return node.type === NodeType_1.NodeType.Program;
-    }
-    static isPropertyNode(node) {
-        return node.type === NodeType_1.NodeType.Property;
-    }
-    static isVariableDeclaratorNode(node) {
-        return node.type === NodeType_1.NodeType.VariableDeclarator;
-    }
-    static parentize(node) {
-        let isRootNode = true;
-        estraverse.replace(node, {
-            enter: (node, parentNode) => {
-                Object.defineProperty(node, 'parentNode', {
-                    configurable: true,
-                    enumerable: true,
-                    value: isRootNode ? NodeUtils.getProgramNode([node]) : parentNode || node,
-                    writable: true
-                });
-                isRootNode = false;
+    }, {
+        key: "isMemberExpressionNode",
+        value: function isMemberExpressionNode(node) {
+            return node.type === NodeType_1.NodeType.MemberExpression;
+        }
+    }, {
+        key: "isNodeHasBlockScope",
+        value: function isNodeHasBlockScope(node) {
+            return node.hasOwnProperty('body');
+        }
+    }, {
+        key: "isProgramNode",
+        value: function isProgramNode(node) {
+            return node.type === NodeType_1.NodeType.Program;
+        }
+    }, {
+        key: "isPropertyNode",
+        value: function isPropertyNode(node) {
+            return node.type === NodeType_1.NodeType.Property;
+        }
+    }, {
+        key: "isVariableDeclaratorNode",
+        value: function isVariableDeclaratorNode(node) {
+            return node.type === NodeType_1.NodeType.VariableDeclarator;
+        }
+    }, {
+        key: "parentize",
+        value: function parentize(node) {
+            var isRootNode = true;
+            estraverse.replace(node, {
+                enter: function enter(node, parentNode) {
+                    Object.defineProperty(node, 'parentNode', {
+                        configurable: true,
+                        enumerable: true,
+                        value: isRootNode ? NodeUtils.getProgramNode([node]) : parentNode || node,
+                        writable: true
+                    });
+                    isRootNode = false;
+                }
+            });
+        }
+    }, {
+        key: "prependNode",
+        value: function prependNode(blockScopeBody, node) {
+            if (!NodeUtils.validateNode(node)) {
+                return;
             }
-        });
-    }
-    static prependNode(blockScopeBody, node) {
-        if (!NodeUtils.validateNode(node)) {
-            return;
+            blockScopeBody.unshift(node);
         }
-        blockScopeBody.unshift(node);
-    }
-    static validateNode(node) {
-        return !!node;
-    }
-}
-NodeUtils.scopeNodes = [
-    NodeType_1.NodeType.ArrowFunctionExpression,
-    NodeType_1.NodeType.FunctionDeclaration,
-    NodeType_1.NodeType.FunctionExpression,
-    NodeType_1.NodeType.MethodDefinition
-];
+    }, {
+        key: "validateNode",
+        value: function validateNode(node) {
+            return !!node;
+        }
+    }]);
+
+    return NodeUtils;
+}();
+
+NodeUtils.scopeNodes = [NodeType_1.NodeType.ArrowFunctionExpression, NodeType_1.NodeType.FunctionDeclaration, NodeType_1.NodeType.FunctionExpression, NodeType_1.NodeType.MethodDefinition];
 exports.NodeUtils = NodeUtils;

+ 112 - 90
dist/src/Obfuscator.js

@@ -1,100 +1,122 @@
 "use strict";
-const estraverse = require('estraverse');
-const AppendState_1 = require('./enums/AppendState');
-const NodeType_1 = require('./enums/NodeType');
-const CatchClauseObfuscator_1 = require('./node-obfuscators/CatchClauseObfuscator');
-const ConsoleOutputDisableExpressionNode_1 = require('./custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode');
-const DebugProtectionNodesGroup_1 = require('./node-groups/DebugProtectionNodesGroup');
-const FunctionDeclarationObfuscator_1 = require('./node-obfuscators/FunctionDeclarationObfuscator');
-const FunctionObfuscator_1 = require('./node-obfuscators/FunctionObfuscator');
-const LiteralObfuscator_1 = require('./node-obfuscators/LiteralObfuscator');
-const MemberExpressionObfuscator_1 = require('./node-obfuscators/MemberExpressionObfuscator');
-const MethodDefinitionObfuscator_1 = require('./node-obfuscators/MethodDefinitionObfuscator');
-const NodeUtils_1 = require("./NodeUtils");
-const ObjectExpressionObfuscator_1 = require('./node-obfuscators/ObjectExpressionObfuscator');
-const SelfDefendingNodesGroup_1 = require("./node-groups/SelfDefendingNodesGroup");
-const UnicodeArrayNodesGroup_1 = require('./node-groups/UnicodeArrayNodesGroup');
-const VariableDeclarationObfuscator_1 = require('./node-obfuscators/VariableDeclarationObfuscator');
-class Obfuscator {
-    constructor(options = {}) {
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var estraverse = require('estraverse');
+var AppendState_1 = require('./enums/AppendState');
+var NodeType_1 = require('./enums/NodeType');
+var CatchClauseObfuscator_1 = require('./node-obfuscators/CatchClauseObfuscator');
+var ConsoleOutputDisableExpressionNode_1 = require('./custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode');
+var DebugProtectionNodesGroup_1 = require('./node-groups/DebugProtectionNodesGroup');
+var FunctionDeclarationObfuscator_1 = require('./node-obfuscators/FunctionDeclarationObfuscator');
+var FunctionObfuscator_1 = require('./node-obfuscators/FunctionObfuscator');
+var LiteralObfuscator_1 = require('./node-obfuscators/LiteralObfuscator');
+var MemberExpressionObfuscator_1 = require('./node-obfuscators/MemberExpressionObfuscator');
+var MethodDefinitionObfuscator_1 = require('./node-obfuscators/MethodDefinitionObfuscator');
+var NodeUtils_1 = require("./NodeUtils");
+var ObjectExpressionObfuscator_1 = require('./node-obfuscators/ObjectExpressionObfuscator');
+var SelfDefendingNodesGroup_1 = require("./node-groups/SelfDefendingNodesGroup");
+var UnicodeArrayNodesGroup_1 = require('./node-groups/UnicodeArrayNodesGroup');
+var VariableDeclarationObfuscator_1 = require('./node-obfuscators/VariableDeclarationObfuscator');
+
+var Obfuscator = function () {
+    function Obfuscator() {
+        var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
+        _classCallCheck(this, Obfuscator);
+
         this.nodes = new Map();
-        this.nodeObfuscators = new Map([
-            [NodeType_1.NodeType.ArrowFunctionExpression, [FunctionObfuscator_1.FunctionObfuscator]],
-            [NodeType_1.NodeType.ClassDeclaration, [FunctionDeclarationObfuscator_1.FunctionDeclarationObfuscator]],
-            [NodeType_1.NodeType.CatchClause, [CatchClauseObfuscator_1.CatchClauseObfuscator]],
-            [NodeType_1.NodeType.FunctionDeclaration, [
-                    FunctionDeclarationObfuscator_1.FunctionDeclarationObfuscator,
-                    FunctionObfuscator_1.FunctionObfuscator
-                ]],
-            [NodeType_1.NodeType.FunctionExpression, [FunctionObfuscator_1.FunctionObfuscator]],
-            [NodeType_1.NodeType.MemberExpression, [MemberExpressionObfuscator_1.MemberExpressionObfuscator]],
-            [NodeType_1.NodeType.MethodDefinition, [MethodDefinitionObfuscator_1.MethodDefinitionObfuscator]],
-            [NodeType_1.NodeType.ObjectExpression, [ObjectExpressionObfuscator_1.ObjectExpressionObfuscator]],
-            [NodeType_1.NodeType.VariableDeclaration, [VariableDeclarationObfuscator_1.VariableDeclarationObfuscator]],
-            [NodeType_1.NodeType.Literal, [LiteralObfuscator_1.LiteralObfuscator]]
-        ]);
+        this.nodeObfuscators = new Map([[NodeType_1.NodeType.ArrowFunctionExpression, [FunctionObfuscator_1.FunctionObfuscator]], [NodeType_1.NodeType.ClassDeclaration, [FunctionDeclarationObfuscator_1.FunctionDeclarationObfuscator]], [NodeType_1.NodeType.CatchClause, [CatchClauseObfuscator_1.CatchClauseObfuscator]], [NodeType_1.NodeType.FunctionDeclaration, [FunctionDeclarationObfuscator_1.FunctionDeclarationObfuscator, FunctionObfuscator_1.FunctionObfuscator]], [NodeType_1.NodeType.FunctionExpression, [FunctionObfuscator_1.FunctionObfuscator]], [NodeType_1.NodeType.MemberExpression, [MemberExpressionObfuscator_1.MemberExpressionObfuscator]], [NodeType_1.NodeType.MethodDefinition, [MethodDefinitionObfuscator_1.MethodDefinitionObfuscator]], [NodeType_1.NodeType.ObjectExpression, [ObjectExpressionObfuscator_1.ObjectExpressionObfuscator]], [NodeType_1.NodeType.VariableDeclaration, [VariableDeclarationObfuscator_1.VariableDeclarationObfuscator]], [NodeType_1.NodeType.Literal, [LiteralObfuscator_1.LiteralObfuscator]]]);
         this.options = options;
     }
-    obfuscateNode(node) {
-        this.setNewNodes();
-        NodeUtils_1.NodeUtils.parentize(node);
-        this.beforeObfuscation(node);
-        this.obfuscate(node);
-        this.afterObfuscation(node);
-        return node;
-    }
-    setNode(nodeName, node) {
-        this.nodes.set(nodeName, node);
-    }
-    setNodesGroup(nodesGroup) {
-        let nodes = nodesGroup.getNodes();
-        nodes.forEach((node, key) => {
-            this.nodes.set(key, node);
-        });
-    }
-    afterObfuscation(astTree) {
-        this.nodes.forEach((node) => {
-            if (node.getAppendState() === AppendState_1.AppendState.AfterObfuscation) {
-                node.appendNode(astTree);
-            }
-        });
-    }
-    beforeObfuscation(astTree) {
-        this.nodes.forEach((node) => {
-            if (node.getAppendState() === AppendState_1.AppendState.BeforeObfuscation) {
-                node.appendNode(astTree);
-            }
-        });
-    }
-    ;
-    initializeNodeObfuscators(node, parentNode) {
-        if (!this.nodeObfuscators.has(node.type)) {
-            return;
+
+    _createClass(Obfuscator, [{
+        key: 'obfuscateNode',
+        value: function obfuscateNode(node) {
+            this.setNewNodes();
+            NodeUtils_1.NodeUtils.parentize(node);
+            this.beforeObfuscation(node);
+            this.obfuscate(node);
+            this.afterObfuscation(node);
+            return node;
         }
-        this.nodeObfuscators.get(node.type).forEach((obfuscator) => {
-            new obfuscator(this.nodes, this.options).obfuscateNode(node, parentNode);
-        });
-    }
-    obfuscate(node) {
-        estraverse.replace(node, {
-            leave: (node, parentNode) => {
-                this.initializeNodeObfuscators(node, parentNode);
-            }
-        });
-    }
-    setNewNodes() {
-        if (this.options['selfDefending']) {
-            this.setNodesGroup(new SelfDefendingNodesGroup_1.SelfDefendingNodesGroup(this.options));
+    }, {
+        key: 'setNode',
+        value: function setNode(nodeName, node) {
+            this.nodes.set(nodeName, node);
         }
-        if (this.options['disableConsoleOutput']) {
-            this.setNode('consoleOutputDisableExpressionNode', new ConsoleOutputDisableExpressionNode_1.ConsoleOutputDisableExpressionNode());
+    }, {
+        key: 'setNodesGroup',
+        value: function setNodesGroup(nodesGroup) {
+            var _this = this;
+
+            var nodes = nodesGroup.getNodes();
+            nodes.forEach(function (node, key) {
+                _this.nodes.set(key, node);
+            });
         }
-        if (this.options['debugProtection']) {
-            this.setNodesGroup(new DebugProtectionNodesGroup_1.DebugProtectionNodesGroup(this.options));
+    }, {
+        key: 'afterObfuscation',
+        value: function afterObfuscation(astTree) {
+            this.nodes.forEach(function (node) {
+                if (node.getAppendState() === AppendState_1.AppendState.AfterObfuscation) {
+                    node.appendNode(astTree);
+                }
+            });
         }
-        if (this.options['unicodeArray']) {
-            this.setNodesGroup(new UnicodeArrayNodesGroup_1.UnicodeArrayNodesGroup(this.options));
+    }, {
+        key: 'beforeObfuscation',
+        value: function beforeObfuscation(astTree) {
+            this.nodes.forEach(function (node) {
+                if (node.getAppendState() === AppendState_1.AppendState.BeforeObfuscation) {
+                    node.appendNode(astTree);
+                }
+            });
         }
-    }
-}
+    }, {
+        key: 'initializeNodeObfuscators',
+        value: function initializeNodeObfuscators(node, parentNode) {
+            var _this2 = this;
+
+            if (!this.nodeObfuscators.has(node.type)) {
+                return;
+            }
+            this.nodeObfuscators.get(node.type).forEach(function (obfuscator) {
+                new obfuscator(_this2.nodes, _this2.options).obfuscateNode(node, parentNode);
+            });
+        }
+    }, {
+        key: 'obfuscate',
+        value: function obfuscate(node) {
+            var _this3 = this;
+
+            estraverse.replace(node, {
+                leave: function leave(node, parentNode) {
+                    _this3.initializeNodeObfuscators(node, parentNode);
+                }
+            });
+        }
+    }, {
+        key: 'setNewNodes',
+        value: function setNewNodes() {
+            if (this.options['selfDefending']) {
+                this.setNodesGroup(new SelfDefendingNodesGroup_1.SelfDefendingNodesGroup(this.options));
+            }
+            if (this.options['disableConsoleOutput']) {
+                this.setNode('consoleOutputDisableExpressionNode', new ConsoleOutputDisableExpressionNode_1.ConsoleOutputDisableExpressionNode());
+            }
+            if (this.options['debugProtection']) {
+                this.setNodesGroup(new DebugProtectionNodesGroup_1.DebugProtectionNodesGroup(this.options));
+            }
+            if (this.options['unicodeArray']) {
+                this.setNodesGroup(new UnicodeArrayNodesGroup_1.UnicodeArrayNodesGroup(this.options));
+            }
+        }
+    }]);
+
+    return Obfuscator;
+}();
+
 exports.Obfuscator = Obfuscator;

+ 45 - 23
dist/src/OptionsNormalizer.js

@@ -1,30 +1,52 @@
 "use strict";
-class OptionsNormalizer {
-    static normalize(options) {
-        let normalizedOptions = Object.assign({}, options);
-        normalizedOptions = OptionsNormalizer.unicodeArrayRule(normalizedOptions);
-        normalizedOptions = OptionsNormalizer.unicodeArrayThresholdRule(normalizedOptions);
-        normalizedOptions = OptionsNormalizer.selfDefendingRule(normalizedOptions);
-        return normalizedOptions;
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var OptionsNormalizer = function () {
+    function OptionsNormalizer() {
+        _classCallCheck(this, OptionsNormalizer);
     }
-    static selfDefendingRule(options) {
-        if (options['selfDefending']) {
-            Object.assign(options, OptionsNormalizer.SELF_DEFENDING_OPTIONS);
+
+    _createClass(OptionsNormalizer, null, [{
+        key: 'normalize',
+        value: function normalize(options) {
+            var normalizedOptions = Object.assign({}, options);
+            normalizedOptions = OptionsNormalizer.unicodeArrayRule(normalizedOptions);
+            normalizedOptions = OptionsNormalizer.unicodeArrayThresholdRule(normalizedOptions);
+            normalizedOptions = OptionsNormalizer.selfDefendingRule(normalizedOptions);
+            return normalizedOptions;
         }
-        return options;
-    }
-    static unicodeArrayRule(options) {
-        if (!options['unicodeArray']) {
-            Object.assign(options, OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS);
+    }, {
+        key: 'selfDefendingRule',
+        value: function selfDefendingRule(options) {
+            if (options['selfDefending']) {
+                Object.assign(options, OptionsNormalizer.SELF_DEFENDING_OPTIONS);
+            }
+            return options;
         }
-        return options;
-    }
-    static unicodeArrayThresholdRule(options) {
-        const minValue = 0, maxValue = 1;
-        options['unicodeArrayThreshold'] = Math.min(Math.max(options['unicodeArrayThreshold'], minValue), maxValue);
-        return options;
-    }
-}
+    }, {
+        key: 'unicodeArrayRule',
+        value: function unicodeArrayRule(options) {
+            if (!options['unicodeArray']) {
+                Object.assign(options, OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS);
+            }
+            return options;
+        }
+    }, {
+        key: 'unicodeArrayThresholdRule',
+        value: function unicodeArrayThresholdRule(options) {
+            var minValue = 0,
+                maxValue = 1;
+            options['unicodeArrayThreshold'] = Math.min(Math.max(options['unicodeArrayThreshold'], minValue), maxValue);
+            return options;
+        }
+    }]);
+
+    return OptionsNormalizer;
+}();
+
 OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS = {
     encodeUnicodeLiterals: false,
     rotateUnicodeArray: false,

+ 101 - 64
dist/src/Utils.js

@@ -1,72 +1,109 @@
 "use strict";
-const JSFuck_1 = require('./enums/JSFuck');
-class Utils {
-    static arrayContains(array, searchElement) {
-        return array.indexOf(searchElement) >= 0;
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var JSFuck_1 = require('./enums/JSFuck');
+
+var Utils = function () {
+    function Utils() {
+        _classCallCheck(this, Utils);
     }
-    static arrayRotate(array, times, reverse = false) {
-        if (times < 0) {
-            return;
+
+    _createClass(Utils, null, [{
+        key: 'arrayContains',
+        value: function arrayContains(array, searchElement) {
+            return array.indexOf(searchElement) >= 0;
         }
-        let newArray = array, temp;
-        while (times--) {
-            if (!reverse) {
-                temp = newArray.pop();
-                newArray.unshift(temp);
+    }, {
+        key: 'arrayRotate',
+        value: function arrayRotate(array, times) {
+            var reverse = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+
+            if (times < 0) {
+                return;
             }
-            else {
-                temp = newArray.shift();
-                newArray.push(temp);
+            var newArray = array,
+                temp = void 0;
+            while (times--) {
+                if (!reverse) {
+                    temp = newArray.pop();
+                    newArray.unshift(temp);
+                } else {
+                    temp = newArray.shift();
+                    newArray.push(temp);
+                }
             }
+            return newArray;
         }
-        return newArray;
-    }
-    static btoa(string) {
-        return new Buffer(encodeURI(string)).toString('base64');
-    }
-    static decToHex(dec) {
-        const decToHexSliceValue = -6, exponent = 6, radix = 16;
-        return (dec + Math.pow(radix, exponent))
-            .toString(radix)
-            .substr(decToHexSliceValue)
-            .replace(Utils.hexRepetitiveZerosRegExp, '');
-    }
-    static getRandomInteger(min, max) {
-        return Math.round(Math.floor(Math.random() * (max - min + 1)) + min);
-    }
-    static getRandomVariableName(length = 6) {
-        const rangeMinInteger = 10000, rangeMaxInteger = 99999999, prefix = '_0x';
-        return `${prefix}${(Utils.decToHex(Utils.getRandomInteger(rangeMinInteger, rangeMaxInteger))).substr(0, length)}`;
-    }
-    static isInteger(number) {
-        return number % 1 === 0;
-    }
-    static strEnumify(obj) {
-        return obj;
-    }
-    static stringToJSFuck(string) {
-        return Array
-            .from(string)
-            .map((character) => {
-            return JSFuck_1.JSFuck[character] || character;
-        })
-            .join(' + ');
-    }
-    static stringToUnicode(string) {
-        const radix = 16;
-        let prefix, regexp = new RegExp('[\x00-\x7F]'), template;
-        return `'${string.replace(/[\s\S]/g, (escape) => {
-            if (regexp.test(escape)) {
-                prefix = '\\x';
-                template = '0'.repeat(2);
-            }
-            else {
-                prefix = '\\u';
-                template = '0'.repeat(4);
-            }
-            return `${prefix}${(template + escape.charCodeAt(0).toString(radix)).slice(-template.length)}`;
-        })}'`;
-    }
-}
+    }, {
+        key: 'btoa',
+        value: function btoa(string) {
+            return new Buffer(encodeURI(string)).toString('base64');
+        }
+    }, {
+        key: 'decToHex',
+        value: function decToHex(dec) {
+            var decToHexSliceValue = -6,
+                exponent = 6,
+                radix = 16;
+            return (dec + Math.pow(radix, exponent)).toString(radix).substr(decToHexSliceValue).replace(Utils.hexRepetitiveZerosRegExp, '');
+        }
+    }, {
+        key: 'getRandomInteger',
+        value: function getRandomInteger(min, max) {
+            return Math.round(Math.floor(Math.random() * (max - min + 1)) + min);
+        }
+    }, {
+        key: 'getRandomVariableName',
+        value: function getRandomVariableName() {
+            var length = arguments.length <= 0 || arguments[0] === undefined ? 6 : arguments[0];
+
+            var rangeMinInteger = 10000,
+                rangeMaxInteger = 99999999,
+                prefix = '_0x';
+            return '' + prefix + Utils.decToHex(Utils.getRandomInteger(rangeMinInteger, rangeMaxInteger)).substr(0, length);
+        }
+    }, {
+        key: 'isInteger',
+        value: function isInteger(number) {
+            return number % 1 === 0;
+        }
+    }, {
+        key: 'strEnumify',
+        value: function strEnumify(obj) {
+            return obj;
+        }
+    }, {
+        key: 'stringToJSFuck',
+        value: function stringToJSFuck(string) {
+            return Array.from(string).map(function (character) {
+                return JSFuck_1.JSFuck[character] || character;
+            }).join(' + ');
+        }
+    }, {
+        key: 'stringToUnicode',
+        value: function stringToUnicode(string) {
+            var radix = 16;
+            var prefix = void 0,
+                regexp = new RegExp('[\x00-\x7F]'),
+                template = void 0;
+            return '\'' + string.replace(/[\s\S]/g, function (escape) {
+                if (regexp.test(escape)) {
+                    prefix = '\\x';
+                    template = '0'.repeat(2);
+                } else {
+                    prefix = '\\u';
+                    template = '0'.repeat(4);
+                }
+                return '' + prefix + (template + escape.charCodeAt(0).toString(radix)).slice(-template.length);
+            }) + '\'';
+        }
+    }]);
+
+    return Utils;
+}();
+
 Utils.hexRepetitiveZerosRegExp = new RegExp('^(0{2,})+(?!$)', '');
 exports.Utils = Utils;

+ 53 - 18
dist/src/custom-nodes/Node.js

@@ -1,23 +1,58 @@
 "use strict";
-const AppendState_1 = require('../enums/AppendState');
-const NodeUtils_1 = require("../NodeUtils");
-class Node {
-    constructor(options = {}) {
+
+var _createClass = function () {
+    function defineProperties(target, props) {
+        for (var i = 0; i < props.length; i++) {
+            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
+        }
+    }return function (Constructor, protoProps, staticProps) {
+        if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
+    };
+}();
+
+function _classCallCheck(instance, Constructor) {
+    if (!(instance instanceof Constructor)) {
+        throw new TypeError("Cannot call a class as a function");
+    }
+}
+
+var AppendState_1 = require('../enums/AppendState');
+var NodeUtils_1 = require("../NodeUtils");
+
+var Node = function () {
+    function Node() {
+        var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
+        _classCallCheck(this, Node);
+
         this.appendState = AppendState_1.AppendState.BeforeObfuscation;
         this.options = options;
     }
-    getAppendState() {
-        return this.appendState;
-    }
-    getNode() {
-        NodeUtils_1.NodeUtils.parentize(this.node);
-        return this.node;
-    }
-    setNode(node) {
-        this.node = node;
-    }
-    updateNode() {
-        this.node = this.getNodeStructure();
-    }
-}
+
+    _createClass(Node, [{
+        key: "getAppendState",
+        value: function getAppendState() {
+            return this.appendState;
+        }
+    }, {
+        key: "getNode",
+        value: function getNode() {
+            NodeUtils_1.NodeUtils.parentize(this.node);
+            return this.node;
+        }
+    }, {
+        key: "setNode",
+        value: function setNode(node) {
+            this.node = node;
+        }
+    }, {
+        key: "updateNode",
+        value: function updateNode() {
+            this.node = this.getNodeStructure();
+        }
+    }]);
+
+    return Node;
+}();
+
 exports.Node = Node;

+ 68 - 26
dist/src/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.js

@@ -1,30 +1,72 @@
 "use strict";
-const esprima = require('esprima');
-const Node_1 = require('../Node');
-const NodeUtils_1 = require("../../NodeUtils");
-class ConsoleOutputDisableExpressionNode extends Node_1.Node {
-    constructor(options = {}) {
-        super(options);
-        this.node = this.getNodeStructure();
-    }
-    appendNode(blockScopeNode) {
-        NodeUtils_1.NodeUtils.prependNode(blockScopeNode.body, this.getNode());
-    }
-    getNodeStructure() {
-        return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(esprima.parse(`
-                (function () {
-                    var _ = '(\u0004\u0006\u0003\u0005[]' + '["filter"]["\u0007tructor"]' + '("return this")()' + '.' + '\u0003;\u0006\u0002\u0005\u0004};' + '_\u0003.log\u0001.in' + 'fo\u0001.' + 'war' + 'n\u0001.er' + 'r' + 'or\u0001})();' + '\u0001\u0005_\u0002;' + '_\u0003\u0002function' + '\u0003\u0007ole\u0004\u0002 ()' + '{\u0005 = \u0006var ' + '_\u0007cons', 
-                        Y, 
-                        $;
-                    
-                    for (Y in $ = "\u0007\u0006\u0005\u0004\u0003\u0002\u0001") {
-                      var arr = _.split($[Y]);
-                      _ = arr.join(arr.pop());
-                    }
-                    
-                    []["filter"]["constructor"](_)();
-                })()
-            `));
+
+var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) {
+    return typeof obj === "undefined" ? "undefined" : _typeof2(obj);
+} : function (obj) {
+    return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof2(obj);
+};
+
+var _createClass = function () {
+    function defineProperties(target, props) {
+        for (var i = 0; i < props.length; i++) {
+            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
+        }
+    }return function (Constructor, protoProps, staticProps) {
+        if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
+    };
+}();
+
+function _classCallCheck(instance, Constructor) {
+    if (!(instance instanceof Constructor)) {
+        throw new TypeError("Cannot call a class as a function");
     }
 }
+
+function _possibleConstructorReturn(self, call) {
+    if (!self) {
+        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
+    }return call && ((typeof call === "undefined" ? "undefined" : _typeof(call)) === "object" || typeof call === "function") ? call : self;
+}
+
+function _inherits(subClass, superClass) {
+    if (typeof superClass !== "function" && superClass !== null) {
+        throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : _typeof(superClass)));
+    }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
+}
+
+var esprima = require('esprima');
+var Node_1 = require('../Node');
+var NodeUtils_1 = require("../../NodeUtils");
+
+var ConsoleOutputDisableExpressionNode = function (_Node_1$Node) {
+    _inherits(ConsoleOutputDisableExpressionNode, _Node_1$Node);
+
+    function ConsoleOutputDisableExpressionNode() {
+        var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
+        _classCallCheck(this, ConsoleOutputDisableExpressionNode);
+
+        var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(ConsoleOutputDisableExpressionNode).call(this, options));
+
+        _this.node = _this.getNodeStructure();
+        return _this;
+    }
+
+    _createClass(ConsoleOutputDisableExpressionNode, [{
+        key: 'appendNode',
+        value: function appendNode(blockScopeNode) {
+            NodeUtils_1.NodeUtils.prependNode(blockScopeNode.body, this.getNode());
+        }
+    }, {
+        key: 'getNodeStructure',
+        value: function getNodeStructure() {
+            return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(esprima.parse("\n                (function () {\n                    var _ = '(\u0004\u0006\u0003\u0005[]' + '[\"filter\"][\"\u0007tructor\"]' + '(\"return this\")()' + '.' + '\u0003;\u0006\u0002\u0005\u0004};' + '_\u0003.log\u0001.in' + 'fo\u0001.' + 'war' + 'n\u0001.er' + 'r' + 'or\u0001})();' + '\u0001\u0005_\u0002;' + '_\u0003\u0002function' + '\u0003\u0007ole\u0004\u0002 ()' + '{\u0005 = \u0006var ' + '_\u0007cons', \n                        Y, \n                        $;\n                    \n                    for (Y in $ = \"\u0007\u0006\u0005\u0004\u0003\u0002\u0001\") {\n                      var arr = _.split($[Y]);\n                      _ = arr.join(arr.pop());\n                    }\n                    \n                    [][\"filter\"][\"constructor\"](_)();\n                })()\n            "));
+        }
+    }]);
+
+    return ConsoleOutputDisableExpressionNode;
+}(Node_1.Node);
+
 exports.ConsoleOutputDisableExpressionNode = ConsoleOutputDisableExpressionNode;

+ 73 - 24
dist/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.js

@@ -1,28 +1,77 @@
 "use strict";
-const NodeType_1 = require("../../enums/NodeType");
-const Node_1 = require('../Node');
-const NodeUtils_1 = require("../../NodeUtils");
-class DebugProtectionFunctionCallNode extends Node_1.Node {
-    constructor(debugProtectionFunctionName, options = {}) {
-        super(options);
-        this.debugProtectionFunctionName = debugProtectionFunctionName;
-        this.node = this.getNodeStructure();
-    }
-    appendNode(blockScopeNode) {
-        NodeUtils_1.NodeUtils.appendNode(blockScopeNode.body, this.getNode());
-    }
-    getNodeStructure() {
-        return {
-            'type': NodeType_1.NodeType.ExpressionStatement,
-            'expression': {
-                'type': NodeType_1.NodeType.CallExpression,
-                'callee': {
-                    'type': NodeType_1.NodeType.Identifier,
-                    'name': this.debugProtectionFunctionName
-                },
-                'arguments': []
-            }
-        };
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+var _createClass = function () {
+    function defineProperties(target, props) {
+        for (var i = 0; i < props.length; i++) {
+            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
+        }
+    }return function (Constructor, protoProps, staticProps) {
+        if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
+    };
+}();
+
+function _classCallCheck(instance, Constructor) {
+    if (!(instance instanceof Constructor)) {
+        throw new TypeError("Cannot call a class as a function");
     }
 }
+
+function _possibleConstructorReturn(self, call) {
+    if (!self) {
+        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
+    }return call && ((typeof call === "undefined" ? "undefined" : _typeof(call)) === "object" || typeof call === "function") ? call : self;
+}
+
+function _inherits(subClass, superClass) {
+    if (typeof superClass !== "function" && superClass !== null) {
+        throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : _typeof(superClass)));
+    }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
+}
+
+var NodeType_1 = require("../../enums/NodeType");
+var Node_1 = require('../Node');
+var NodeUtils_1 = require("../../NodeUtils");
+
+var DebugProtectionFunctionCallNode = function (_Node_1$Node) {
+    _inherits(DebugProtectionFunctionCallNode, _Node_1$Node);
+
+    function DebugProtectionFunctionCallNode(debugProtectionFunctionName) {
+        var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
+
+        _classCallCheck(this, DebugProtectionFunctionCallNode);
+
+        var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(DebugProtectionFunctionCallNode).call(this, options));
+
+        _this.debugProtectionFunctionName = debugProtectionFunctionName;
+        _this.node = _this.getNodeStructure();
+        return _this;
+    }
+
+    _createClass(DebugProtectionFunctionCallNode, [{
+        key: "appendNode",
+        value: function appendNode(blockScopeNode) {
+            NodeUtils_1.NodeUtils.appendNode(blockScopeNode.body, this.getNode());
+        }
+    }, {
+        key: "getNodeStructure",
+        value: function getNodeStructure() {
+            return {
+                'type': NodeType_1.NodeType.ExpressionStatement,
+                'expression': {
+                    'type': NodeType_1.NodeType.CallExpression,
+                    'callee': {
+                        'type': NodeType_1.NodeType.Identifier,
+                        'name': this.debugProtectionFunctionName
+                    },
+                    'arguments': []
+                }
+            };
+        }
+    }]);
+
+    return DebugProtectionFunctionCallNode;
+}(Node_1.Node);
+
 exports.DebugProtectionFunctionCallNode = DebugProtectionFunctionCallNode;

+ 85 - 41
dist/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.js

@@ -1,58 +1,102 @@
 "use strict";
-const NodeType_1 = require('../../enums/NodeType');
-const Node_1 = require('../Node');
-const NodeUtils_1 = require('../../NodeUtils');
-class DebugProtectionFunctionIntervalNode extends Node_1.Node {
-    constructor(debugProtectionFunctionName, options = {}) {
-        super(options);
-        this.debugProtectionFunctionName = debugProtectionFunctionName;
-        this.node = this.getNodeStructure();
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+var _createClass = function () {
+    function defineProperties(target, props) {
+        for (var i = 0; i < props.length; i++) {
+            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
+        }
+    }return function (Constructor, protoProps, staticProps) {
+        if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
+    };
+}();
+
+function _classCallCheck(instance, Constructor) {
+    if (!(instance instanceof Constructor)) {
+        throw new TypeError("Cannot call a class as a function");
     }
-    appendNode(blockScopeNode) {
-        NodeUtils_1.NodeUtils.appendNode(blockScopeNode.body, this.getNode());
+}
+
+function _possibleConstructorReturn(self, call) {
+    if (!self) {
+        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
+    }return call && ((typeof call === "undefined" ? "undefined" : _typeof(call)) === "object" || typeof call === "function") ? call : self;
+}
+
+function _inherits(subClass, superClass) {
+    if (typeof superClass !== "function" && superClass !== null) {
+        throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : _typeof(superClass)));
+    }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
+}
+
+var NodeType_1 = require('../../enums/NodeType');
+var Node_1 = require('../Node');
+var NodeUtils_1 = require('../../NodeUtils');
+
+var DebugProtectionFunctionIntervalNode = function (_Node_1$Node) {
+    _inherits(DebugProtectionFunctionIntervalNode, _Node_1$Node);
+
+    function DebugProtectionFunctionIntervalNode(debugProtectionFunctionName) {
+        var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
+
+        _classCallCheck(this, DebugProtectionFunctionIntervalNode);
+
+        var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(DebugProtectionFunctionIntervalNode).call(this, options));
+
+        _this.debugProtectionFunctionName = debugProtectionFunctionName;
+        _this.node = _this.getNodeStructure();
+        return _this;
     }
-    getNodeStructure() {
-        return {
-            'type': NodeType_1.NodeType.ExpressionStatement,
-            'expression': {
-                'type': NodeType_1.NodeType.CallExpression,
-                'callee': {
-                    'type': NodeType_1.NodeType.Identifier,
-                    'name': 'setInterval'
-                },
-                'arguments': [
-                    {
+
+    _createClass(DebugProtectionFunctionIntervalNode, [{
+        key: 'appendNode',
+        value: function appendNode(blockScopeNode) {
+            NodeUtils_1.NodeUtils.appendNode(blockScopeNode.body, this.getNode());
+        }
+    }, {
+        key: 'getNodeStructure',
+        value: function getNodeStructure() {
+            return {
+                'type': NodeType_1.NodeType.ExpressionStatement,
+                'expression': {
+                    'type': NodeType_1.NodeType.CallExpression,
+                    'callee': {
+                        'type': NodeType_1.NodeType.Identifier,
+                        'name': 'setInterval'
+                    },
+                    'arguments': [{
                         'type': NodeType_1.NodeType.FunctionExpression,
                         'id': null,
                         'params': [],
                         'defaults': [],
                         'body': {
                             'type': NodeType_1.NodeType.BlockStatement,
-                            'body': [
-                                {
-                                    'type': NodeType_1.NodeType.ExpressionStatement,
-                                    'expression': {
-                                        'type': NodeType_1.NodeType.CallExpression,
-                                        'callee': {
-                                            'type': NodeType_1.NodeType.Identifier,
-                                            'name': this.debugProtectionFunctionName
-                                        },
-                                        'arguments': []
-                                    }
+                            'body': [{
+                                'type': NodeType_1.NodeType.ExpressionStatement,
+                                'expression': {
+                                    'type': NodeType_1.NodeType.CallExpression,
+                                    'callee': {
+                                        'type': NodeType_1.NodeType.Identifier,
+                                        'name': this.debugProtectionFunctionName
+                                    },
+                                    'arguments': []
                                 }
-                            ]
+                            }]
                         },
                         'generator': false,
                         'expression': false
-                    },
-                    {
+                    }, {
                         'type': NodeType_1.NodeType.Literal,
                         'value': 4000,
                         'raw': '4000'
-                    }
-                ]
-            }
-        };
-    }
-}
+                    }]
+                }
+            };
+        }
+    }]);
+
+    return DebugProtectionFunctionIntervalNode;
+}(Node_1.Node);
+
 exports.DebugProtectionFunctionIntervalNode = DebugProtectionFunctionIntervalNode;

+ 50 - 36
dist/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.js

@@ -1,39 +1,53 @@
 "use strict";
-const esprima = require('esprima');
-const Node_1 = require('../Node');
-const NodeUtils_1 = require('../../NodeUtils');
-const Utils_1 = require("../../Utils");
-class DebugProtectionFunctionNode extends Node_1.Node {
-    constructor(debugProtectionFunctionName, options = {}) {
-        super(options);
-        this.debugProtectionFunctionName = debugProtectionFunctionName;
-        this.node = this.getNodeStructure();
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var esprima = require('esprima');
+var Node_1 = require('../Node');
+var NodeUtils_1 = require('../../NodeUtils');
+var Utils_1 = require("../../Utils");
+
+var DebugProtectionFunctionNode = function (_Node_1$Node) {
+    _inherits(DebugProtectionFunctionNode, _Node_1$Node);
+
+    function DebugProtectionFunctionNode(debugProtectionFunctionName) {
+        var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
+
+        _classCallCheck(this, DebugProtectionFunctionNode);
+
+        var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(DebugProtectionFunctionNode).call(this, options));
+
+        _this.debugProtectionFunctionName = debugProtectionFunctionName;
+        _this.node = _this.getNodeStructure();
+        return _this;
     }
-    appendNode(blockScopeNode) {
-        let programBodyLength = blockScopeNode.body.length, randomIndex = Utils_1.Utils.getRandomInteger(0, programBodyLength);
-        NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), randomIndex);
-    }
-    getNodeIdentifier() {
-        return this.debugProtectionFunctionName;
-    }
-    getNodeStructure() {
-        return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(esprima.parse(`
-                var ${this.debugProtectionFunctionName} = function () {
-                    function debuggerProtection (counter) {
-                        if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {
-                            (function () {}.constructor('debugger')());
-                        } else {
-                            [].filter.constructor(${Utils_1.Utils.stringToJSFuck('debugger')})();
-                        }
-                        
-                        debuggerProtection(++counter);
-                    }
-                    
-                    try {
-                        debuggerProtection(0);
-                    } catch (y) {}
-                };
-            `));
-    }
-}
+
+    _createClass(DebugProtectionFunctionNode, [{
+        key: 'appendNode',
+        value: function appendNode(blockScopeNode) {
+            var programBodyLength = blockScopeNode.body.length,
+                randomIndex = Utils_1.Utils.getRandomInteger(0, programBodyLength);
+            NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), randomIndex);
+        }
+    }, {
+        key: 'getNodeIdentifier',
+        value: function getNodeIdentifier() {
+            return this.debugProtectionFunctionName;
+        }
+    }, {
+        key: 'getNodeStructure',
+        value: function getNodeStructure() {
+            return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(esprima.parse('\n                var ' + this.debugProtectionFunctionName + ' = function () {\n                    function debuggerProtection (counter) {\n                        if ((\'\' + counter / counter)[\'length\'] !== 1 || counter % 20 === 0) {\n                            (function () {}.constructor(\'debugger\')());\n                        } else {\n                            [].filter.constructor(' + Utils_1.Utils.stringToJSFuck('debugger') + ')();\n                        }\n                        \n                        debuggerProtection(++counter);\n                    }\n                    \n                    try {\n                        debuggerProtection(0);\n                    } catch (y) {}\n                };\n            '));
+        }
+    }]);
+
+    return DebugProtectionFunctionNode;
+}(Node_1.Node);
+
 exports.DebugProtectionFunctionNode = DebugProtectionFunctionNode;

+ 80 - 33
dist/src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.js

@@ -1,38 +1,85 @@
 "use strict";
-const esprima = require('esprima');
-const AppendState_1 = require("../../enums/AppendState");
-const JSFuck_1 = require("../../enums/JSFuck");
-const NoCustomNodesPreset_1 = require("../../preset-options/NoCustomNodesPreset");
-const JavaScriptObfuscator_1 = require("../../JavaScriptObfuscator");
-const Node_1 = require('../Node');
-const NodeUtils_1 = require("../../NodeUtils");
-const Utils_1 = require("../../Utils");
-class SelfDefendingUnicodeNode extends Node_1.Node {
-    constructor(options = {}) {
-        super(options);
-        this.appendState = AppendState_1.AppendState.AfterObfuscation;
-        this.node = this.getNodeStructure();
-    }
-    appendNode(blockScopeNode) {
-        let programBodyLength = blockScopeNode.body.length, randomIndex = 0;
-        if (programBodyLength > 2) {
-            randomIndex = Utils_1.Utils.getRandomInteger(programBodyLength / 2, programBodyLength - 1);
+
+var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) {
+    return typeof obj === "undefined" ? "undefined" : _typeof2(obj);
+} : function (obj) {
+    return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof2(obj);
+};
+
+var _createClass = function () {
+    function defineProperties(target, props) {
+        for (var i = 0; i < props.length; i++) {
+            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
         }
-        NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), randomIndex);
-    }
-    getNodeStructure() {
-        let node = esprima.parse(JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(`
-                (function () {                                
-                    var func = function(){return ${Utils_1.Utils.stringToUnicode('dev')};},
-                        func2 = function () {
-                            return 'window';
-                        };
-                
-                    !Function(${Utils_1.Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})().test(func.toString()) ? Function(${Utils_1.Utils.stringToUnicode(`return/(\\\\[x|u](\\w){2,4})+/`)})().test(func2.toString()) ? []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.False}){}')() : []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.True}){}')() : []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.False}){}')();
-                })();
-            `, NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET));
-        NodeUtils_1.NodeUtils.addXVerbatimPropertyToLiterals(node);
-        return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(node);
+    }return function (Constructor, protoProps, staticProps) {
+        if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
+    };
+}();
+
+function _classCallCheck(instance, Constructor) {
+    if (!(instance instanceof Constructor)) {
+        throw new TypeError("Cannot call a class as a function");
     }
 }
+
+function _possibleConstructorReturn(self, call) {
+    if (!self) {
+        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
+    }return call && ((typeof call === "undefined" ? "undefined" : _typeof(call)) === "object" || typeof call === "function") ? call : self;
+}
+
+function _inherits(subClass, superClass) {
+    if (typeof superClass !== "function" && superClass !== null) {
+        throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : _typeof(superClass)));
+    }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
+}
+
+var esprima = require('esprima');
+var AppendState_1 = require("../../enums/AppendState");
+var JSFuck_1 = require("../../enums/JSFuck");
+var NoCustomNodesPreset_1 = require("../../preset-options/NoCustomNodesPreset");
+var JavaScriptObfuscator_1 = require("../../JavaScriptObfuscator");
+var Node_1 = require('../Node');
+var NodeUtils_1 = require("../../NodeUtils");
+var Utils_1 = require("../../Utils");
+
+var SelfDefendingUnicodeNode = function (_Node_1$Node) {
+    _inherits(SelfDefendingUnicodeNode, _Node_1$Node);
+
+    function SelfDefendingUnicodeNode() {
+        var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
+        _classCallCheck(this, SelfDefendingUnicodeNode);
+
+        var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(SelfDefendingUnicodeNode).call(this, options));
+
+        _this.appendState = AppendState_1.AppendState.AfterObfuscation;
+        _this.node = _this.getNodeStructure();
+        return _this;
+    }
+
+    _createClass(SelfDefendingUnicodeNode, [{
+        key: "appendNode",
+        value: function appendNode(blockScopeNode) {
+            var programBodyLength = blockScopeNode.body.length,
+                randomIndex = 0;
+            if (programBodyLength > 2) {
+                randomIndex = Utils_1.Utils.getRandomInteger(programBodyLength / 2, programBodyLength - 1);
+            }
+            NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), randomIndex);
+        }
+    }, {
+        key: "getNodeStructure",
+        value: function getNodeStructure() {
+            var node = esprima.parse(JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate("\n                (function () {                                \n                    var func = function(){return " + Utils_1.Utils.stringToUnicode('dev') + ";},\n                        func2 = function () {\n                            return 'window';\n                        };\n                \n                    !Function(" + Utils_1.Utils.stringToUnicode("return/\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}/") + ")().test(func.toString()) ? Function(" + Utils_1.Utils.stringToUnicode("return/(\\\\[x|u](\\w){2,4})+/") + ")().test(func2.toString()) ? []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(" + JSFuck_1.JSFuck.False + "){}')() : []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(" + JSFuck_1.JSFuck.True + "){}')() : []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(" + JSFuck_1.JSFuck.False + "){}')();\n                })();\n            ", NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET));
+            NodeUtils_1.NodeUtils.addXVerbatimPropertyToLiterals(node);
+            return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(node);
+        }
+    }]);
+
+    return SelfDefendingUnicodeNode;
+}(Node_1.Node);
+
 exports.SelfDefendingUnicodeNode = SelfDefendingUnicodeNode;

+ 66 - 37
dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayCallsWrapper.js

@@ -1,41 +1,70 @@
 "use strict";
-const esprima = require('esprima');
-const AppendState_1 = require("../../enums/AppendState");
-const Node_1 = require('../Node');
-const NodeUtils_1 = require("../../NodeUtils");
-const Utils_1 = require("../../Utils");
-class UnicodeArrayCallsWrapper extends Node_1.Node {
-    constructor(unicodeArrayCallsWrapperName, unicodeArrayName, unicodeArray, options = {}) {
-        super(options);
-        this.appendState = AppendState_1.AppendState.AfterObfuscation;
-        this.unicodeArrayCallsWrapperName = unicodeArrayCallsWrapperName;
-        this.unicodeArrayName = unicodeArrayName;
-        this.unicodeArray = unicodeArray;
-        this.node = this.getNodeStructure();
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var esprima = require('esprima');
+var AppendState_1 = require("../../enums/AppendState");
+var Node_1 = require('../Node');
+var NodeUtils_1 = require("../../NodeUtils");
+var Utils_1 = require("../../Utils");
+
+var UnicodeArrayCallsWrapper = function (_Node_1$Node) {
+    _inherits(UnicodeArrayCallsWrapper, _Node_1$Node);
+
+    function UnicodeArrayCallsWrapper(unicodeArrayCallsWrapperName, unicodeArrayName, unicodeArray) {
+        var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
+
+        _classCallCheck(this, UnicodeArrayCallsWrapper);
+
+        var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayCallsWrapper).call(this, options));
+
+        _this.appendState = AppendState_1.AppendState.AfterObfuscation;
+        _this.unicodeArrayCallsWrapperName = unicodeArrayCallsWrapperName;
+        _this.unicodeArrayName = unicodeArrayName;
+        _this.unicodeArray = unicodeArray;
+        _this.node = _this.getNodeStructure();
+        return _this;
     }
-    appendNode(blockScopeNode) {
-        NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
-    }
-    getNodeIdentifier() {
-        return this.unicodeArrayCallsWrapperName;
-    }
-    ;
-    getNode() {
-        if (!this.unicodeArray.length) {
-            return;
+
+    _createClass(UnicodeArrayCallsWrapper, [{
+        key: "appendNode",
+        value: function appendNode(blockScopeNode) {
+            NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
         }
-        this.updateNode();
-        return super.getNode();
-    }
-    getNodeStructure() {
-        let keyName = Utils_1.Utils.getRandomVariableName(), node;
-        node = esprima.parse(`
-            var ${this.unicodeArrayCallsWrapperName} = function (${keyName}) {
-                return ${this.unicodeArrayName}[parseInt(${keyName}, 0x010)];
-            };
-        `);
-        NodeUtils_1.NodeUtils.addXVerbatimPropertyToLiterals(node);
-        return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(node);
-    }
-}
+    }, {
+        key: "getNodeIdentifier",
+        value: function getNodeIdentifier() {
+            return this.unicodeArrayCallsWrapperName;
+        }
+    }, {
+        key: "getNode",
+        value: function getNode() {
+            if (!this.unicodeArray.length) {
+                return;
+            }
+            this.updateNode();
+            return _get(Object.getPrototypeOf(UnicodeArrayCallsWrapper.prototype), "getNode", this).call(this);
+        }
+    }, {
+        key: "getNodeStructure",
+        value: function getNodeStructure() {
+            var keyName = Utils_1.Utils.getRandomVariableName(),
+                node = void 0;
+            node = esprima.parse("\n            var " + this.unicodeArrayCallsWrapperName + " = function (" + keyName + ") {\n                return " + this.unicodeArrayName + "[parseInt(" + keyName + ", 0x010)];\n            };\n        ");
+            NodeUtils_1.NodeUtils.addXVerbatimPropertyToLiterals(node);
+            return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(node);
+        }
+    }]);
+
+    return UnicodeArrayCallsWrapper;
+}(Node_1.Node);
+
 exports.UnicodeArrayCallsWrapper = UnicodeArrayCallsWrapper;

+ 70 - 75
dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.js

@@ -1,81 +1,76 @@
 "use strict";
-const esprima = require('esprima');
-const JavaScriptObfuscator_1 = require('../../JavaScriptObfuscator');
-const AppendState_1 = require("../../enums/AppendState");
-const JSFuck_1 = require("../../enums/JSFuck");
-const NoCustomNodesPreset_1 = require("../../preset-options/NoCustomNodesPreset");
-const Node_1 = require('../Node');
-const NodeUtils_1 = require("../../NodeUtils");
-const Utils_1 = require("../../Utils");
-class UnicodeArrayDecodeNode extends Node_1.Node {
-    constructor(unicodeArrayName, unicodeArray, options = {}) {
-        super(options);
-        this.appendState = AppendState_1.AppendState.AfterObfuscation;
-        this.unicodeArrayName = unicodeArrayName;
-        this.unicodeArray = unicodeArray;
-        this.node = this.getNodeStructure();
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var esprima = require('esprima');
+var JavaScriptObfuscator_1 = require('../../JavaScriptObfuscator');
+var AppendState_1 = require("../../enums/AppendState");
+var JSFuck_1 = require("../../enums/JSFuck");
+var NoCustomNodesPreset_1 = require("../../preset-options/NoCustomNodesPreset");
+var Node_1 = require('../Node');
+var NodeUtils_1 = require("../../NodeUtils");
+var Utils_1 = require("../../Utils");
+
+var UnicodeArrayDecodeNode = function (_Node_1$Node) {
+    _inherits(UnicodeArrayDecodeNode, _Node_1$Node);
+
+    function UnicodeArrayDecodeNode(unicodeArrayName, unicodeArray) {
+        var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
+
+        _classCallCheck(this, UnicodeArrayDecodeNode);
+
+        var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayDecodeNode).call(this, options));
+
+        _this.appendState = AppendState_1.AppendState.AfterObfuscation;
+        _this.unicodeArrayName = unicodeArrayName;
+        _this.unicodeArray = unicodeArray;
+        _this.node = _this.getNodeStructure();
+        return _this;
     }
-    appendNode(blockScopeNode) {
-        NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
-    }
-    getNode() {
-        if (!this.unicodeArray.length) {
-            return;
+
+    _createClass(UnicodeArrayDecodeNode, [{
+        key: 'appendNode',
+        value: function appendNode(blockScopeNode) {
+            NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
         }
-        this.updateNode();
-        return super.getNode();
-    }
-    getNodeStructure() {
-        const environmentName = Utils_1.Utils.getRandomVariableName(), forLoopFunctionName = Utils_1.Utils.getRandomVariableName(), indexVariableName = Utils_1.Utils.getRandomVariableName(), tempArrayName = Utils_1.Utils.getRandomVariableName();
-        let code = '', node;
-        if (this.options['selfDefending']) {
-            code = `
-                var ${environmentName} = function(){return ${Utils_1.Utils.stringToUnicode('dev')};};
-                   
-                Function(${Utils_1.Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})()[${Utils_1.Utils.stringToUnicode('test')}](${environmentName}[${Utils_1.Utils.stringToUnicode('toString')}]()) !== ${JSFuck_1.JSFuck.True} && !${this.unicodeArrayName}++ ? []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.True}){}')() : Function(${Utils_1.Utils.stringToUnicode('a')}, atob(${Utils_1.Utils.stringToUnicode(Utils_1.Utils.btoa('a.call()'))}))(${forLoopFunctionName}) ? []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.False}){}')() : []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.False}){}')();
-            `;
+    }, {
+        key: 'getNode',
+        value: function getNode() {
+            if (!this.unicodeArray.length) {
+                return;
+            }
+            this.updateNode();
+            return _get(Object.getPrototypeOf(UnicodeArrayDecodeNode.prototype), 'getNode', this).call(this);
         }
-        else {
-            code = `${forLoopFunctionName}();`;
+    }, {
+        key: 'getNodeStructure',
+        value: function getNodeStructure() {
+            var environmentName = Utils_1.Utils.getRandomVariableName(),
+                forLoopFunctionName = Utils_1.Utils.getRandomVariableName(),
+                indexVariableName = Utils_1.Utils.getRandomVariableName(),
+                tempArrayName = Utils_1.Utils.getRandomVariableName();
+            var code = '',
+                node = void 0;
+            if (this.options['selfDefending']) {
+                code = '\n                var ' + environmentName + ' = function(){return ' + Utils_1.Utils.stringToUnicode('dev') + ';};\n                   \n                Function(' + Utils_1.Utils.stringToUnicode('return/\\w+ *\\(\\) *{\\w+ *[\'|"].+[\'|"];? *}/') + ')()[' + Utils_1.Utils.stringToUnicode('test') + '](' + environmentName + '[' + Utils_1.Utils.stringToUnicode('toString') + ']()) !== ' + JSFuck_1.JSFuck.True + ' && !' + this.unicodeArrayName + '++ ? [][\'filter\'][\'constructor\'](' + Utils_1.Utils.stringToJSFuck('while') + ' + \'(' + JSFuck_1.JSFuck.True + '){}\')() : Function(' + Utils_1.Utils.stringToUnicode('a') + ', atob(' + Utils_1.Utils.stringToUnicode(Utils_1.Utils.btoa('a.call()')) + '))(' + forLoopFunctionName + ') ? [][\'filter\'][\'constructor\'](' + Utils_1.Utils.stringToJSFuck('while') + ' + \'(' + JSFuck_1.JSFuck.False + '){}\')() : [][\'filter\'][\'constructor\'](' + Utils_1.Utils.stringToJSFuck('while') + ' + \'(' + JSFuck_1.JSFuck.False + '){}\')();\n            ';
+            } else {
+                code = forLoopFunctionName + '();';
+            }
+            node = esprima.parse('\n            (function () {\n                ' + JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate('\n                    (function () {\n                        var object = [][\'filter\'][\'constructor\'](\'return this\')();\n                        var chars = \'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\';\n            \n                        object.atob || (\n                            object.atob = function(input) {\n                                var str = String(input).replace(/=+$/, \'\');\n                                for (\n                                    var bc = 0, bs, buffer, idx = 0, output = \'\';\n                                    buffer = str.charAt(idx++);\n                                    ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n                                        bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n                                ) {\n                                    buffer = chars.indexOf(buffer);\n                                }\n                            return output;\n                        });\n                    })();\n                ', NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET) + '\n              \n                var ' + forLoopFunctionName + ' = function () {\n                    var ' + tempArrayName + ' = [];\n                    \n                    for (var ' + indexVariableName + ' in ' + this.unicodeArrayName + ') {\n                        ' + tempArrayName + '[' + Utils_1.Utils.stringToUnicode('push') + '](decodeURI(atob(' + this.unicodeArrayName + '[' + indexVariableName + '])));\n                    }\n                    \n                    ' + this.unicodeArrayName + ' = ' + tempArrayName + ';\n                };\n                \n                ' + code + '\n            })();\n        ');
+            NodeUtils_1.NodeUtils.addXVerbatimPropertyToLiterals(node);
+            return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(node);
         }
-        node = esprima.parse(`
-            (function () {
-                ${JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(`
-                    (function () {
-                        var object = []['filter']['constructor']('return this')();
-                        var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
-            
-                        object.atob || (
-                            object.atob = function(input) {
-                                var str = String(input).replace(/=+$/, '');
-                                for (
-                                    var bc = 0, bs, buffer, idx = 0, output = '';
-                                    buffer = str.charAt(idx++);
-                                    ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,
-                                        bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0
-                                ) {
-                                    buffer = chars.indexOf(buffer);
-                                }
-                            return output;
-                        });
-                    })();
-                `, NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET)}
-              
-                var ${forLoopFunctionName} = function () {
-                    var ${tempArrayName} = [];
-                    
-                    for (var ${indexVariableName} in ${this.unicodeArrayName}) {
-                        ${tempArrayName}[${Utils_1.Utils.stringToUnicode('push')}](decodeURI(atob(${this.unicodeArrayName}[${indexVariableName}])));
-                    }
-                    
-                    ${this.unicodeArrayName} = ${tempArrayName};
-                };
-                
-                ${code}
-            })();
-        `);
-        NodeUtils_1.NodeUtils.addXVerbatimPropertyToLiterals(node);
-        return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(node);
-    }
-}
+    }]);
+
+    return UnicodeArrayDecodeNode;
+}(Node_1.Node);
+
 exports.UnicodeArrayDecodeNode = UnicodeArrayDecodeNode;

+ 82 - 46
dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayNode.js

@@ -1,44 +1,77 @@
 "use strict";
-const escodegen = require('escodegen');
-const AppendState_1 = require('../../enums/AppendState');
-const NodeType_1 = require("../../enums/NodeType");
-const Node_1 = require('../Node');
-const NodeUtils_1 = require("../../NodeUtils");
-const Utils_1 = require('../../Utils');
-class UnicodeArrayNode extends Node_1.Node {
-    constructor(unicodeArrayName, unicodeArrayRotateValue = 0, options = {}) {
-        super(options);
-        this.appendState = AppendState_1.AppendState.AfterObfuscation;
-        this.unicodeArray = [];
-        this.unicodeArrayName = unicodeArrayName;
-        this.unicodeArrayRotateValue = unicodeArrayRotateValue;
-        this.node = this.getNodeStructure();
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var escodegen = require('escodegen');
+var AppendState_1 = require('../../enums/AppendState');
+var NodeType_1 = require("../../enums/NodeType");
+var Node_1 = require('../Node');
+var NodeUtils_1 = require("../../NodeUtils");
+var Utils_1 = require('../../Utils');
+
+var UnicodeArrayNode = function (_Node_1$Node) {
+    _inherits(UnicodeArrayNode, _Node_1$Node);
+
+    function UnicodeArrayNode(unicodeArrayName) {
+        var unicodeArrayRotateValue = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];
+        var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
+
+        _classCallCheck(this, UnicodeArrayNode);
+
+        var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayNode).call(this, options));
+
+        _this.appendState = AppendState_1.AppendState.AfterObfuscation;
+        _this.unicodeArray = [];
+        _this.unicodeArrayName = unicodeArrayName;
+        _this.unicodeArrayRotateValue = unicodeArrayRotateValue;
+        _this.node = _this.getNodeStructure();
+        return _this;
     }
-    appendNode(blockScopeNode) {
-        NodeUtils_1.NodeUtils.prependNode(blockScopeNode.body, this.getNode());
-    }
-    getNodeIdentifier() {
-        return this.unicodeArrayName;
-    }
-    getNodeData() {
-        return this.unicodeArray;
-    }
-    getNode() {
-        if (!this.unicodeArray.length) {
-            return;
+
+    _createClass(UnicodeArrayNode, [{
+        key: 'appendNode',
+        value: function appendNode(blockScopeNode) {
+            NodeUtils_1.NodeUtils.prependNode(blockScopeNode.body, this.getNode());
         }
-        Utils_1.Utils.arrayRotate(this.unicodeArray, this.unicodeArrayRotateValue);
-        this.updateNode();
-        return super.getNode();
-    }
-    updateNodeData(data) {
-        this.unicodeArray.push(data);
-    }
-    getNodeStructure() {
-        return {
-            'type': NodeType_1.NodeType.VariableDeclaration,
-            'declarations': [
-                {
+    }, {
+        key: 'getNodeIdentifier',
+        value: function getNodeIdentifier() {
+            return this.unicodeArrayName;
+        }
+    }, {
+        key: 'getNodeData',
+        value: function getNodeData() {
+            return this.unicodeArray;
+        }
+    }, {
+        key: 'getNode',
+        value: function getNode() {
+            if (!this.unicodeArray.length) {
+                return;
+            }
+            Utils_1.Utils.arrayRotate(this.unicodeArray, this.unicodeArrayRotateValue);
+            this.updateNode();
+            return _get(Object.getPrototypeOf(UnicodeArrayNode.prototype), 'getNode', this).call(this);
+        }
+    }, {
+        key: 'updateNodeData',
+        value: function updateNodeData(data) {
+            this.unicodeArray.push(data);
+        }
+    }, {
+        key: 'getNodeStructure',
+        value: function getNodeStructure() {
+            return {
+                'type': NodeType_1.NodeType.VariableDeclaration,
+                'declarations': [{
                     'type': NodeType_1.NodeType.VariableDeclarator,
                     'id': {
                         'type': NodeType_1.NodeType.Identifier,
@@ -46,11 +79,11 @@ class UnicodeArrayNode extends Node_1.Node {
                     },
                     'init': {
                         'type': NodeType_1.NodeType.ArrayExpression,
-                        'elements': this.unicodeArray.map((value) => {
+                        'elements': this.unicodeArray.map(function (value) {
                             return {
                                 'type': NodeType_1.NodeType.Literal,
                                 'value': value,
-                                'raw': `'${value}'`,
+                                'raw': '\'' + value + '\'',
                                 'x-verbatim-property': {
                                     'content': value,
                                     precedence: escodegen.Precedence.Primary
@@ -58,11 +91,14 @@ class UnicodeArrayNode extends Node_1.Node {
                             };
                         })
                     }
-                }
-            ],
-            'kind': 'var'
-        };
-    }
-}
+                }],
+                'kind': 'var'
+            };
+        }
+    }]);
+
+    return UnicodeArrayNode;
+}(Node_1.Node);
+
 UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH = 4;
 exports.UnicodeArrayNode = UnicodeArrayNode;

+ 70 - 51
dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode.js

@@ -1,57 +1,76 @@
 "use strict";
-const esprima = require('esprima');
-const AppendState_1 = require("../../enums/AppendState");
-const JSFuck_1 = require("../../enums/JSFuck");
-const NoCustomNodesPreset_1 = require("../../preset-options/NoCustomNodesPreset");
-const JavaScriptObfuscator_1 = require("../../JavaScriptObfuscator");
-const Node_1 = require('../Node');
-const NodeUtils_1 = require("../../NodeUtils");
-const Utils_1 = require("../../Utils");
-class UnicodeArrayRotateFunctionNode extends Node_1.Node {
-    constructor(unicodeArrayName, unicodeArray, unicodeArrayRotateValue, options = {}) {
-        super(options);
-        this.appendState = AppendState_1.AppendState.AfterObfuscation;
-        this.unicodeArrayName = unicodeArrayName;
-        this.unicodeArray = unicodeArray;
-        this.unicodeArrayRotateValue = unicodeArrayRotateValue;
-        this.node = this.getNodeStructure();
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var esprima = require('esprima');
+var AppendState_1 = require("../../enums/AppendState");
+var JSFuck_1 = require("../../enums/JSFuck");
+var NoCustomNodesPreset_1 = require("../../preset-options/NoCustomNodesPreset");
+var JavaScriptObfuscator_1 = require("../../JavaScriptObfuscator");
+var Node_1 = require('../Node');
+var NodeUtils_1 = require("../../NodeUtils");
+var Utils_1 = require("../../Utils");
+
+var UnicodeArrayRotateFunctionNode = function (_Node_1$Node) {
+    _inherits(UnicodeArrayRotateFunctionNode, _Node_1$Node);
+
+    function UnicodeArrayRotateFunctionNode(unicodeArrayName, unicodeArray, unicodeArrayRotateValue) {
+        var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
+
+        _classCallCheck(this, UnicodeArrayRotateFunctionNode);
+
+        var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayRotateFunctionNode).call(this, options));
+
+        _this.appendState = AppendState_1.AppendState.AfterObfuscation;
+        _this.unicodeArrayName = unicodeArrayName;
+        _this.unicodeArray = unicodeArray;
+        _this.unicodeArrayRotateValue = unicodeArrayRotateValue;
+        _this.node = _this.getNodeStructure();
+        return _this;
     }
-    appendNode(blockScopeNode) {
-        NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
-    }
-    getNode() {
-        if (!this.unicodeArray.length) {
-            return;
+
+    _createClass(UnicodeArrayRotateFunctionNode, [{
+        key: "appendNode",
+        value: function appendNode(blockScopeNode) {
+            NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
         }
-        return super.getNode();
-    }
-    getNodeStructure() {
-        let arrayName = Utils_1.Utils.getRandomVariableName(), code = '', timesName = Utils_1.Utils.getRandomVariableName(), timesArgumentName = Utils_1.Utils.getRandomVariableName(), whileFunctionName = Utils_1.Utils.getRandomVariableName(), node;
-        if (this.options['selfDefending']) {
-            code = JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(`
-                (function () {
-                    var func = function(){return ${Utils_1.Utils.stringToUnicode('dev')};};
-                                        
-                    !Function(${Utils_1.Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})().test(func.toString()) ? []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.True}){}')() : Function(${Utils_1.Utils.stringToUnicode('a')}, ${Utils_1.Utils.stringToUnicode('b')}, ${Utils_1.Utils.stringToUnicode('a(++b)')})(${whileFunctionName}, ${timesName}) ? []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.False}){}')() : []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.False}){}')();
-                })();
-            `, NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET);
+    }, {
+        key: "getNode",
+        value: function getNode() {
+            if (!this.unicodeArray.length) {
+                return;
+            }
+            return _get(Object.getPrototypeOf(UnicodeArrayRotateFunctionNode.prototype), "getNode", this).call(this);
         }
-        else {
-            code = `${whileFunctionName}(++${timesName})`;
+    }, {
+        key: "getNodeStructure",
+        value: function getNodeStructure() {
+            var arrayName = Utils_1.Utils.getRandomVariableName(),
+                code = '',
+                timesName = Utils_1.Utils.getRandomVariableName(),
+                timesArgumentName = Utils_1.Utils.getRandomVariableName(),
+                whileFunctionName = Utils_1.Utils.getRandomVariableName(),
+                node = void 0;
+            if (this.options['selfDefending']) {
+                code = JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate("\n                (function () {\n                    var func = function(){return " + Utils_1.Utils.stringToUnicode('dev') + ";};\n                                        \n                    !Function(" + Utils_1.Utils.stringToUnicode("return/\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}/") + ")().test(func.toString()) ? []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(" + JSFuck_1.JSFuck.True + "){}')() : Function(" + Utils_1.Utils.stringToUnicode('a') + ", " + Utils_1.Utils.stringToUnicode('b') + ", " + Utils_1.Utils.stringToUnicode('a(++b)') + ")(" + whileFunctionName + ", " + timesName + ") ? []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(" + JSFuck_1.JSFuck.False + "){}')() : []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(" + JSFuck_1.JSFuck.False + "){}')();\n                })();\n            ", NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET);
+            } else {
+                code = whileFunctionName + "(++" + timesName + ")";
+            }
+            node = esprima.parse("\n            (function (" + arrayName + ", " + timesName + ") {\n                var " + whileFunctionName + " = function (" + timesArgumentName + ") {\n                    while (--" + timesArgumentName + ") {\n                        " + arrayName + "[" + Utils_1.Utils.stringToUnicode('push') + "](" + arrayName + "[" + Utils_1.Utils.stringToUnicode('shift') + "]());\n                    }\n                };\n                \n                " + code + "\n            })(" + this.unicodeArrayName + ", 0x" + Utils_1.Utils.decToHex(this.unicodeArrayRotateValue) + ");\n        ");
+            NodeUtils_1.NodeUtils.addXVerbatimPropertyToLiterals(node);
+            return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(node);
         }
-        node = esprima.parse(`
-            (function (${arrayName}, ${timesName}) {
-                var ${whileFunctionName} = function (${timesArgumentName}) {
-                    while (--${timesArgumentName}) {
-                        ${arrayName}[${Utils_1.Utils.stringToUnicode('push')}](${arrayName}[${Utils_1.Utils.stringToUnicode('shift')}]());
-                    }
-                };
-                
-                ${code}
-            })(${this.unicodeArrayName}, 0x${Utils_1.Utils.decToHex(this.unicodeArrayRotateValue)});
-        `);
-        NodeUtils_1.NodeUtils.addXVerbatimPropertyToLiterals(node);
-        return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(node);
-    }
-}
+    }]);
+
+    return UnicodeArrayRotateFunctionNode;
+}(Node_1.Node);
+
 exports.UnicodeArrayRotateFunctionNode = UnicodeArrayRotateFunctionNode;

+ 1 - 0
dist/src/enums/AppendState.js

@@ -1,4 +1,5 @@
 "use strict";
+
 (function (AppendState) {
     AppendState[AppendState["AfterObfuscation"] = 0] = "AfterObfuscation";
     AppendState[AppendState["BeforeObfuscation"] = 1] = "BeforeObfuscation";

+ 12 - 11
dist/src/enums/JSFuck.js

@@ -1,4 +1,5 @@
 "use strict";
+
 exports.JSFuck = {
     Window: '[]["filter"]["constructor"]("return this")()',
     False: '![]',
@@ -36,23 +37,23 @@ exports.JSFuck = {
     E: '(RegExp+"")[12]',
     F: '(+[]+Function)[10]',
     G: '(false+Function("return Date")()())[30]',
-    H: `'H'`,
+    H: '\'H\'',
     I: '(Infinity+"")[0]',
-    J: `'J'`,
-    K: `'K'`,
-    L: `'L'`,
+    J: '\'J\'',
+    K: '\'K\'',
+    L: '\'L\'',
     M: '(true+Function("return Date")()())[30]',
     N: '(NaN+"")[0]',
     O: '(NaN+Function("return{}")())[11]',
-    P: `'P'`,
-    Q: `'Q'`,
+    P: '\'P\'',
+    Q: '\'Q\'',
     R: '(+[]+RegExp)[10]',
     S: '(+[]+String)[10]',
     T: '(NaN+Function("return Date")()())[30]',
     U: '(NaN+Function("return{}")()["to"+String["name"]]["call"]())[11]',
-    V: `'V'`,
-    W: `'W'`,
-    X: `'X'`,
-    Y: `'Y'`,
-    Z: `'Z'`
+    V: '\'V\'',
+    W: '\'W\'',
+    X: '\'X\'',
+    Y: '\'Y\'',
+    Z: '\'Z\''
 };

+ 2 - 1
dist/src/enums/NodeType.js

@@ -1,5 +1,6 @@
 "use strict";
-const Utils_1 = require("../Utils");
+
+var Utils_1 = require("../Utils");
 exports.NodeType = Utils_1.Utils.strEnumify({
     ArrayExpression: 'ArrayExpression',
     ArrowFunctionExpression: 'ArrowFunctionExpression',

+ 33 - 14
dist/src/node-groups/DebugProtectionNodesGroup.js

@@ -1,18 +1,37 @@
 "use strict";
-const DebugProtectionFunctionCallNode_1 = require("../custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode");
-const DebugProtectionFunctionIntervalNode_1 = require("../custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode");
-const DebugProtectionFunctionNode_1 = require("../custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode");
-const NodesGroup_1 = require('./NodesGroup');
-const Utils_1 = require('../Utils');
-class DebugProtectionNodesGroup extends NodesGroup_1.NodesGroup {
-    constructor(options = {}) {
-        super(options);
-        this.debugProtectionFunctionIdentifier = Utils_1.Utils.getRandomVariableName();
-        this.nodes.set('debugProtectionFunctionNode', new DebugProtectionFunctionNode_1.DebugProtectionFunctionNode(this.debugProtectionFunctionIdentifier, this.options));
-        this.nodes.set('debugProtectionFunctionCallNode', new DebugProtectionFunctionCallNode_1.DebugProtectionFunctionCallNode(this.debugProtectionFunctionIdentifier, this.options));
-        if (this.options['debugProtectionInterval']) {
-            this.nodes.set('debugProtectionFunctionIntervalNode', new DebugProtectionFunctionIntervalNode_1.DebugProtectionFunctionIntervalNode(this.debugProtectionFunctionIdentifier, this.options));
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var DebugProtectionFunctionCallNode_1 = require("../custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode");
+var DebugProtectionFunctionIntervalNode_1 = require("../custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode");
+var DebugProtectionFunctionNode_1 = require("../custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode");
+var NodesGroup_1 = require('./NodesGroup');
+var Utils_1 = require('../Utils');
+
+var DebugProtectionNodesGroup = function (_NodesGroup_1$NodesGr) {
+    _inherits(DebugProtectionNodesGroup, _NodesGroup_1$NodesGr);
+
+    function DebugProtectionNodesGroup() {
+        var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
+        _classCallCheck(this, DebugProtectionNodesGroup);
+
+        var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(DebugProtectionNodesGroup).call(this, options));
+
+        _this.debugProtectionFunctionIdentifier = Utils_1.Utils.getRandomVariableName();
+        _this.nodes.set('debugProtectionFunctionNode', new DebugProtectionFunctionNode_1.DebugProtectionFunctionNode(_this.debugProtectionFunctionIdentifier, _this.options));
+        _this.nodes.set('debugProtectionFunctionCallNode', new DebugProtectionFunctionCallNode_1.DebugProtectionFunctionCallNode(_this.debugProtectionFunctionIdentifier, _this.options));
+        if (_this.options['debugProtectionInterval']) {
+            _this.nodes.set('debugProtectionFunctionIntervalNode', new DebugProtectionFunctionIntervalNode_1.DebugProtectionFunctionIntervalNode(_this.debugProtectionFunctionIdentifier, _this.options));
         }
+        return _this;
     }
-}
+
+    return DebugProtectionNodesGroup;
+}(NodesGroup_1.NodesGroup);
+
 exports.DebugProtectionNodesGroup = DebugProtectionNodesGroup;

+ 34 - 6
dist/src/node-groups/NodesGroup.js

@@ -1,11 +1,39 @@
 "use strict";
-class NodesGroup {
-    constructor(options = {}) {
+
+var _createClass = function () {
+    function defineProperties(target, props) {
+        for (var i = 0; i < props.length; i++) {
+            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
+        }
+    }return function (Constructor, protoProps, staticProps) {
+        if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
+    };
+}();
+
+function _classCallCheck(instance, Constructor) {
+    if (!(instance instanceof Constructor)) {
+        throw new TypeError("Cannot call a class as a function");
+    }
+}
+
+var NodesGroup = function () {
+    function NodesGroup() {
+        var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
+        _classCallCheck(this, NodesGroup);
+
         this.nodes = new Map();
         this.options = options;
     }
-    getNodes() {
-        return this.nodes;
-    }
-}
+
+    _createClass(NodesGroup, [{
+        key: "getNodes",
+        value: function getNodes() {
+            return this.nodes;
+        }
+    }]);
+
+    return NodesGroup;
+}();
+
 exports.NodesGroup = NodesGroup;

+ 26 - 7
dist/src/node-groups/SelfDefendingNodesGroup.js

@@ -1,10 +1,29 @@
 "use strict";
-const NodesGroup_1 = require('./NodesGroup');
-const SelfDefendingUnicodeNode_1 = require("../custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode");
-class SelfDefendingNodesGroup extends NodesGroup_1.NodesGroup {
-    constructor(options = {}) {
-        super(options);
-        this.nodes.set('selfDefendingUnicodeNode', new SelfDefendingUnicodeNode_1.SelfDefendingUnicodeNode(this.options));
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var NodesGroup_1 = require('./NodesGroup');
+var SelfDefendingUnicodeNode_1 = require("../custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode");
+
+var SelfDefendingNodesGroup = function (_NodesGroup_1$NodesGr) {
+    _inherits(SelfDefendingNodesGroup, _NodesGroup_1$NodesGr);
+
+    function SelfDefendingNodesGroup() {
+        var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
+        _classCallCheck(this, SelfDefendingNodesGroup);
+
+        var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(SelfDefendingNodesGroup).call(this, options));
+
+        _this.nodes.set('selfDefendingUnicodeNode', new SelfDefendingUnicodeNode_1.SelfDefendingUnicodeNode(_this.options));
+        return _this;
     }
-}
+
+    return SelfDefendingNodesGroup;
+}(NodesGroup_1.NodesGroup);
+
 exports.SelfDefendingNodesGroup = SelfDefendingNodesGroup;

+ 55 - 21
dist/src/node-groups/UnicodeArrayNodesGroup.js

@@ -1,27 +1,61 @@
 "use strict";
-const NodesGroup_1 = require('./NodesGroup');
-const UnicodeArrayCallsWrapper_1 = require("../custom-nodes/unicode-array-nodes/UnicodeArrayCallsWrapper");
-const UnicodeArrayDecodeNode_1 = require("../custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode");
-const UnicodeArrayNode_1 = require('../custom-nodes/unicode-array-nodes/UnicodeArrayNode');
-const UnicodeArrayRotateFunctionNode_1 = require('../custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode');
-const Utils_1 = require('../Utils');
-class UnicodeArrayNodesGroup extends NodesGroup_1.NodesGroup {
-    constructor(options = {}) {
-        super(options);
-        this.unicodeArrayName = Utils_1.Utils.getRandomVariableName(UnicodeArrayNode_1.UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
-        this.unicodeArrayTranslatorName = Utils_1.Utils.getRandomVariableName(UnicodeArrayNode_1.UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
-        this.unicodeArrayRotateValue = this.options['rotateUnicodeArray'] ? Utils_1.Utils.getRandomInteger(100, 500) : 0;
-        let unicodeArrayNode = new UnicodeArrayNode_1.UnicodeArrayNode(this.unicodeArrayName, this.unicodeArrayRotateValue, this.options), unicodeArray = unicodeArrayNode.getNodeData();
-        this.nodes.set('unicodeArrayNode', unicodeArrayNode);
-        if (this.options['wrapUnicodeArrayCalls']) {
-            this.nodes.set('unicodeArrayCallsWrapper', new UnicodeArrayCallsWrapper_1.UnicodeArrayCallsWrapper(this.unicodeArrayTranslatorName, this.unicodeArrayName, unicodeArray, this.options));
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+function _classCallCheck(instance, Constructor) {
+    if (!(instance instanceof Constructor)) {
+        throw new TypeError("Cannot call a class as a function");
+    }
+}
+
+function _possibleConstructorReturn(self, call) {
+    if (!self) {
+        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
+    }return call && ((typeof call === "undefined" ? "undefined" : _typeof(call)) === "object" || typeof call === "function") ? call : self;
+}
+
+function _inherits(subClass, superClass) {
+    if (typeof superClass !== "function" && superClass !== null) {
+        throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : _typeof(superClass)));
+    }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
+}
+
+var NodesGroup_1 = require('./NodesGroup');
+var UnicodeArrayCallsWrapper_1 = require("../custom-nodes/unicode-array-nodes/UnicodeArrayCallsWrapper");
+var UnicodeArrayDecodeNode_1 = require("../custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode");
+var UnicodeArrayNode_1 = require('../custom-nodes/unicode-array-nodes/UnicodeArrayNode');
+var UnicodeArrayRotateFunctionNode_1 = require('../custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode');
+var Utils_1 = require('../Utils');
+
+var UnicodeArrayNodesGroup = function (_NodesGroup_1$NodesGr) {
+    _inherits(UnicodeArrayNodesGroup, _NodesGroup_1$NodesGr);
+
+    function UnicodeArrayNodesGroup() {
+        var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
+        _classCallCheck(this, UnicodeArrayNodesGroup);
+
+        var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayNodesGroup).call(this, options));
+
+        _this.unicodeArrayName = Utils_1.Utils.getRandomVariableName(UnicodeArrayNode_1.UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
+        _this.unicodeArrayTranslatorName = Utils_1.Utils.getRandomVariableName(UnicodeArrayNode_1.UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
+        _this.unicodeArrayRotateValue = _this.options['rotateUnicodeArray'] ? Utils_1.Utils.getRandomInteger(100, 500) : 0;
+        var unicodeArrayNode = new UnicodeArrayNode_1.UnicodeArrayNode(_this.unicodeArrayName, _this.unicodeArrayRotateValue, _this.options),
+            unicodeArray = unicodeArrayNode.getNodeData();
+        _this.nodes.set('unicodeArrayNode', unicodeArrayNode);
+        if (_this.options['wrapUnicodeArrayCalls']) {
+            _this.nodes.set('unicodeArrayCallsWrapper', new UnicodeArrayCallsWrapper_1.UnicodeArrayCallsWrapper(_this.unicodeArrayTranslatorName, _this.unicodeArrayName, unicodeArray, _this.options));
         }
-        if (this.options['encodeUnicodeLiterals']) {
-            this.nodes.set('unicodeArrayDecodeNode', new UnicodeArrayDecodeNode_1.UnicodeArrayDecodeNode(this.unicodeArrayName, unicodeArray, this.options));
+        if (_this.options['encodeUnicodeLiterals']) {
+            _this.nodes.set('unicodeArrayDecodeNode', new UnicodeArrayDecodeNode_1.UnicodeArrayDecodeNode(_this.unicodeArrayName, unicodeArray, _this.options));
         }
-        if (this.options['rotateUnicodeArray']) {
-            this.nodes.set('unicodeArrayRotateFunctionNode', new UnicodeArrayRotateFunctionNode_1.UnicodeArrayRotateFunctionNode(this.unicodeArrayName, unicodeArray, this.unicodeArrayRotateValue, this.options));
+        if (_this.options['rotateUnicodeArray']) {
+            _this.nodes.set('unicodeArrayRotateFunctionNode', new UnicodeArrayRotateFunctionNode_1.UnicodeArrayRotateFunctionNode(_this.unicodeArrayName, unicodeArray, _this.unicodeArrayRotateValue, _this.options));
         }
+        return _this;
     }
-}
+
+    return UnicodeArrayNodesGroup;
+}(NodesGroup_1.NodesGroup);
+
 exports.UnicodeArrayNodesGroup = UnicodeArrayNodesGroup;

+ 68 - 31
dist/src/node-obfuscators/CatchClauseObfuscator.js

@@ -1,35 +1,72 @@
 "use strict";
-const estraverse = require('estraverse');
-const NodeObfuscator_1 = require('./NodeObfuscator');
-const NodeUtils_1 = require("../NodeUtils");
-const Utils_1 = require('../Utils');
-class CatchClauseObfuscator extends NodeObfuscator_1.NodeObfuscator {
-    constructor(...args) {
-        super(...args);
-        this.catchClauseParam = new Map();
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var estraverse = require('estraverse');
+var NodeObfuscator_1 = require('./NodeObfuscator');
+var NodeUtils_1 = require("../NodeUtils");
+var Utils_1 = require('../Utils');
+
+var CatchClauseObfuscator = function (_NodeObfuscator_1$Nod) {
+    _inherits(CatchClauseObfuscator, _NodeObfuscator_1$Nod);
+
+    function CatchClauseObfuscator() {
+        var _Object$getPrototypeO;
+
+        _classCallCheck(this, CatchClauseObfuscator);
+
+        for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+            args[_key] = arguments[_key];
+        }
+
+        var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(CatchClauseObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
+
+        _this.catchClauseParam = new Map();
+        return _this;
     }
-    obfuscateNode(catchClauseNode) {
-        this.replaceCatchClauseParam(catchClauseNode);
-        this.replaceCatchClauseParamInBlock(catchClauseNode);
-    }
-    replaceCatchClauseParam(catchClauseNode) {
-        estraverse.replace(catchClauseNode.param, {
-            leave: (node, parentNode) => {
-                if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !this.isReservedName(node.name)) {
-                    this.catchClauseParam.set(node.name, Utils_1.Utils.getRandomVariableName());
-                    node.name = this.catchClauseParam.get(node.name);
-                    return;
+
+    _createClass(CatchClauseObfuscator, [{
+        key: 'obfuscateNode',
+        value: function obfuscateNode(catchClauseNode) {
+            this.replaceCatchClauseParam(catchClauseNode);
+            this.replaceCatchClauseParamInBlock(catchClauseNode);
+        }
+    }, {
+        key: 'replaceCatchClauseParam',
+        value: function replaceCatchClauseParam(catchClauseNode) {
+            var _this2 = this;
+
+            estraverse.replace(catchClauseNode.param, {
+                leave: function leave(node, parentNode) {
+                    if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !_this2.isReservedName(node.name)) {
+                        _this2.catchClauseParam.set(node.name, Utils_1.Utils.getRandomVariableName());
+                        node.name = _this2.catchClauseParam.get(node.name);
+                        return;
+                    }
+                    return estraverse.VisitorOption.Skip;
                 }
-                return estraverse.VisitorOption.Skip;
-            }
-        });
-    }
-    replaceCatchClauseParamInBlock(catchClauseNode) {
-        estraverse.replace(catchClauseNode.body, {
-            leave: (node, parentNode) => {
-                this.replaceNodeIdentifierByNewValue(node, parentNode, this.catchClauseParam);
-            }
-        });
-    }
-}
+            });
+        }
+    }, {
+        key: 'replaceCatchClauseParamInBlock',
+        value: function replaceCatchClauseParamInBlock(catchClauseNode) {
+            var _this3 = this;
+
+            estraverse.replace(catchClauseNode.body, {
+                leave: function leave(node, parentNode) {
+                    _this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.catchClauseParam);
+                }
+            });
+        }
+    }]);
+
+    return CatchClauseObfuscator;
+}(NodeObfuscator_1.NodeObfuscator);
+
 exports.CatchClauseObfuscator = CatchClauseObfuscator;

+ 72 - 35
dist/src/node-obfuscators/FunctionDeclarationObfuscator.js

@@ -1,40 +1,77 @@
 "use strict";
-const estraverse = require('estraverse');
-const NodeType_1 = require("../enums/NodeType");
-const NodeObfuscator_1 = require('./NodeObfuscator');
-const NodeUtils_1 = require("../NodeUtils");
-const Utils_1 = require('../Utils');
-class FunctionDeclarationObfuscator extends NodeObfuscator_1.NodeObfuscator {
-    constructor(...args) {
-        super(...args);
-        this.functionName = new Map();
-    }
-    obfuscateNode(functionDeclarationNode, parentNode) {
-        if (parentNode.type === NodeType_1.NodeType.Program) {
-            return;
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var estraverse = require('estraverse');
+var NodeType_1 = require("../enums/NodeType");
+var NodeObfuscator_1 = require('./NodeObfuscator');
+var NodeUtils_1 = require("../NodeUtils");
+var Utils_1 = require('../Utils');
+
+var FunctionDeclarationObfuscator = function (_NodeObfuscator_1$Nod) {
+    _inherits(FunctionDeclarationObfuscator, _NodeObfuscator_1$Nod);
+
+    function FunctionDeclarationObfuscator() {
+        var _Object$getPrototypeO;
+
+        _classCallCheck(this, FunctionDeclarationObfuscator);
+
+        for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+            args[_key] = arguments[_key];
         }
-        this.replaceFunctionName(functionDeclarationNode);
-        this.replaceFunctionCalls(functionDeclarationNode);
+
+        var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(FunctionDeclarationObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
+
+        _this.functionName = new Map();
+        return _this;
     }
-    replaceFunctionName(functionDeclarationNode) {
-        estraverse.replace(functionDeclarationNode.id, {
-            leave: (node) => {
-                if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !this.isReservedName(node.name)) {
-                    this.functionName.set(node.name, Utils_1.Utils.getRandomVariableName());
-                    node.name = this.functionName.get(node.name);
-                    return;
-                }
-                return estraverse.VisitorOption.Skip;
+
+    _createClass(FunctionDeclarationObfuscator, [{
+        key: "obfuscateNode",
+        value: function obfuscateNode(functionDeclarationNode, parentNode) {
+            if (parentNode.type === NodeType_1.NodeType.Program) {
+                return;
             }
-        });
-    }
-    replaceFunctionCalls(functionDeclarationNode) {
-        let scopeNode = NodeUtils_1.NodeUtils.getBlockScopeOfNode(functionDeclarationNode);
-        estraverse.replace(scopeNode, {
-            enter: (node, parentNode) => {
-                this.replaceNodeIdentifierByNewValue(node, parentNode, this.functionName);
-            }
-        });
-    }
-}
+            this.replaceFunctionName(functionDeclarationNode);
+            this.replaceFunctionCalls(functionDeclarationNode);
+        }
+    }, {
+        key: "replaceFunctionName",
+        value: function replaceFunctionName(functionDeclarationNode) {
+            var _this2 = this;
+
+            estraverse.replace(functionDeclarationNode.id, {
+                leave: function leave(node) {
+                    if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !_this2.isReservedName(node.name)) {
+                        _this2.functionName.set(node.name, Utils_1.Utils.getRandomVariableName());
+                        node.name = _this2.functionName.get(node.name);
+                        return;
+                    }
+                    return estraverse.VisitorOption.Skip;
+                }
+            });
+        }
+    }, {
+        key: "replaceFunctionCalls",
+        value: function replaceFunctionCalls(functionDeclarationNode) {
+            var _this3 = this;
+
+            var scopeNode = NodeUtils_1.NodeUtils.getBlockScopeOfNode(functionDeclarationNode);
+            estraverse.replace(scopeNode, {
+                enter: function enter(node, parentNode) {
+                    _this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.functionName);
+                }
+            });
+        }
+    }]);
+
+    return FunctionDeclarationObfuscator;
+}(NodeObfuscator_1.NodeObfuscator);
+
 exports.FunctionDeclarationObfuscator = FunctionDeclarationObfuscator;

+ 68 - 31
dist/src/node-obfuscators/FunctionObfuscator.js

@@ -1,37 +1,74 @@
 "use strict";
-const estraverse = require('estraverse');
-const NodeObfuscator_1 = require('./NodeObfuscator');
-const NodeUtils_1 = require("../NodeUtils");
-const Utils_1 = require('../Utils');
-class FunctionObfuscator extends NodeObfuscator_1.NodeObfuscator {
-    constructor(...args) {
-        super(...args);
-        this.functionParams = new Map();
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var estraverse = require('estraverse');
+var NodeObfuscator_1 = require('./NodeObfuscator');
+var NodeUtils_1 = require("../NodeUtils");
+var Utils_1 = require('../Utils');
+
+var FunctionObfuscator = function (_NodeObfuscator_1$Nod) {
+    _inherits(FunctionObfuscator, _NodeObfuscator_1$Nod);
+
+    function FunctionObfuscator() {
+        var _Object$getPrototypeO;
+
+        _classCallCheck(this, FunctionObfuscator);
+
+        for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+            args[_key] = arguments[_key];
+        }
+
+        var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(FunctionObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
+
+        _this.functionParams = new Map();
+        return _this;
     }
-    obfuscateNode(functionNode) {
-        this.replaceFunctionParams(functionNode);
-        this.replaceFunctionParamsInBody(functionNode);
-    }
-    replaceFunctionParams(functionNode) {
-        functionNode.params.forEach((paramsNode) => {
-            estraverse.replace(paramsNode, {
-                leave: (node) => {
-                    if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !this.isReservedName(node.name)) {
-                        this.functionParams.set(node.name, Utils_1.Utils.getRandomVariableName());
-                        node.name = this.functionParams.get(node.name);
-                        return;
+
+    _createClass(FunctionObfuscator, [{
+        key: 'obfuscateNode',
+        value: function obfuscateNode(functionNode) {
+            this.replaceFunctionParams(functionNode);
+            this.replaceFunctionParamsInBody(functionNode);
+        }
+    }, {
+        key: 'replaceFunctionParams',
+        value: function replaceFunctionParams(functionNode) {
+            var _this2 = this;
+
+            functionNode.params.forEach(function (paramsNode) {
+                estraverse.replace(paramsNode, {
+                    leave: function leave(node) {
+                        if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !_this2.isReservedName(node.name)) {
+                            _this2.functionParams.set(node.name, Utils_1.Utils.getRandomVariableName());
+                            node.name = _this2.functionParams.get(node.name);
+                            return;
+                        }
+                        return estraverse.VisitorOption.Skip;
                     }
-                    return estraverse.VisitorOption.Skip;
+                });
+            });
+        }
+    }, {
+        key: 'replaceFunctionParamsInBody',
+        value: function replaceFunctionParamsInBody(functionNode) {
+            var _this3 = this;
+
+            estraverse.replace(functionNode.body, {
+                leave: function leave(node, parentNode) {
+                    _this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.functionParams);
                 }
             });
-        });
-    }
-    replaceFunctionParamsInBody(functionNode) {
-        estraverse.replace(functionNode.body, {
-            leave: (node, parentNode) => {
-                this.replaceNodeIdentifierByNewValue(node, parentNode, this.functionParams);
-            }
-        });
-    }
-}
+        }
+    }]);
+
+    return FunctionObfuscator;
+}(NodeObfuscator_1.NodeObfuscator);
+
 exports.FunctionObfuscator = FunctionObfuscator;

+ 55 - 29
dist/src/node-obfuscators/LiteralObfuscator.js

@@ -1,33 +1,59 @@
 "use strict";
-const escodegen = require('escodegen');
-const NodeObfuscator_1 = require('./NodeObfuscator');
-const NodeUtils_1 = require("../NodeUtils");
-class LiteralObfuscator extends NodeObfuscator_1.NodeObfuscator {
-    obfuscateNode(literalNode, parentNode) {
-        if (NodeUtils_1.NodeUtils.isPropertyNode(parentNode) && parentNode.key === literalNode) {
-            return;
-        }
-        if (literalNode['x-verbatim-property']) {
-            return;
-        }
-        let content;
-        switch (typeof literalNode.value) {
-            case 'boolean':
-                content = this.replaceLiteralBooleanByJSFuck(literalNode.value);
-                break;
-            case 'number':
-                content = this.replaceLiteralNumberByHexadecimalValue(literalNode.value);
-                break;
-            case 'string':
-                content = this.replaceLiteralValueByUnicodeValue(literalNode.value);
-                break;
-            default:
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var escodegen = require('escodegen');
+var NodeObfuscator_1 = require('./NodeObfuscator');
+var NodeUtils_1 = require("../NodeUtils");
+
+var LiteralObfuscator = function (_NodeObfuscator_1$Nod) {
+    _inherits(LiteralObfuscator, _NodeObfuscator_1$Nod);
+
+    function LiteralObfuscator() {
+        _classCallCheck(this, LiteralObfuscator);
+
+        return _possibleConstructorReturn(this, Object.getPrototypeOf(LiteralObfuscator).apply(this, arguments));
+    }
+
+    _createClass(LiteralObfuscator, [{
+        key: 'obfuscateNode',
+        value: function obfuscateNode(literalNode, parentNode) {
+            if (NodeUtils_1.NodeUtils.isPropertyNode(parentNode) && parentNode.key === literalNode) {
                 return;
+            }
+            if (literalNode['x-verbatim-property']) {
+                return;
+            }
+            var content = void 0;
+            switch (_typeof(literalNode.value)) {
+                case 'boolean':
+                    content = this.replaceLiteralBooleanByJSFuck(literalNode.value);
+                    break;
+                case 'number':
+                    content = this.replaceLiteralNumberByHexadecimalValue(literalNode.value);
+                    break;
+                case 'string':
+                    content = this.replaceLiteralValueByUnicodeValue(literalNode.value);
+                    break;
+                default:
+                    return;
+            }
+            literalNode['x-verbatim-property'] = {
+                content: content,
+                precedence: escodegen.Precedence.Primary
+            };
         }
-        literalNode['x-verbatim-property'] = {
-            content: content,
-            precedence: escodegen.Precedence.Primary
-        };
-    }
-}
+    }]);
+
+    return LiteralObfuscator;
+}(NodeObfuscator_1.NodeObfuscator);
+
 exports.LiteralObfuscator = LiteralObfuscator;

+ 80 - 47
dist/src/node-obfuscators/MemberExpressionObfuscator.js

@@ -1,54 +1,87 @@
 "use strict";
-const escodegen = require('escodegen');
-const estraverse = require('estraverse');
-const NodeType_1 = require("../enums/NodeType");
-const NodeObfuscator_1 = require('./NodeObfuscator');
-const NodeUtils_1 = require("../NodeUtils");
-class MemberExpressionObfuscator extends NodeObfuscator_1.NodeObfuscator {
-    obfuscateNode(memberExpressionNode) {
-        estraverse.replace(memberExpressionNode.property, {
-            leave: (node, parentNode) => {
-                if (NodeUtils_1.NodeUtils.isLiteralNode(node)) {
-                    this.literalNodeController(node);
-                    return;
-                }
-                if (NodeUtils_1.NodeUtils.isIdentifierNode(node)) {
-                    if (memberExpressionNode.computed) {
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var escodegen = require('escodegen');
+var estraverse = require('estraverse');
+var NodeType_1 = require("../enums/NodeType");
+var NodeObfuscator_1 = require('./NodeObfuscator');
+var NodeUtils_1 = require("../NodeUtils");
+
+var MemberExpressionObfuscator = function (_NodeObfuscator_1$Nod) {
+    _inherits(MemberExpressionObfuscator, _NodeObfuscator_1$Nod);
+
+    function MemberExpressionObfuscator() {
+        _classCallCheck(this, MemberExpressionObfuscator);
+
+        return _possibleConstructorReturn(this, Object.getPrototypeOf(MemberExpressionObfuscator).apply(this, arguments));
+    }
+
+    _createClass(MemberExpressionObfuscator, [{
+        key: 'obfuscateNode',
+        value: function obfuscateNode(memberExpressionNode) {
+            var _this2 = this;
+
+            estraverse.replace(memberExpressionNode.property, {
+                leave: function leave(node, parentNode) {
+                    if (NodeUtils_1.NodeUtils.isLiteralNode(node)) {
+                        _this2.literalNodeController(node);
                         return;
                     }
-                    memberExpressionNode.computed = true;
-                    this.identifierNodeController(node);
-                }
-            }
-        });
-    }
-    identifierNodeController(node) {
-        let nodeValue = node.name, literalNode = {
-            raw: `'${nodeValue}'`,
-            'x-verbatim-property': {
-                content: this.replaceLiteralValueByUnicodeValue(nodeValue),
-                precedence: escodegen.Precedence.Primary
-            },
-            type: NodeType_1.NodeType.Literal,
-            value: nodeValue
-        };
-        delete node.name;
-        Object.assign(node, literalNode);
-    }
-    literalNodeController(node) {
-        switch (typeof node.value) {
-            case 'string':
-                if (node['x-verbatim-property']) {
-                    break;
+                    if (NodeUtils_1.NodeUtils.isIdentifierNode(node)) {
+                        if (memberExpressionNode.computed) {
+                            return;
+                        }
+                        memberExpressionNode.computed = true;
+                        _this2.identifierNodeController(node);
+                    }
                 }
-                node['x-verbatim-property'] = {
-                    content: this.replaceLiteralValueByUnicodeValue(node.value),
+            });
+        }
+    }, {
+        key: 'identifierNodeController',
+        value: function identifierNodeController(node) {
+            var nodeValue = node.name,
+                literalNode = {
+                raw: '\'' + nodeValue + '\'',
+                'x-verbatim-property': {
+                    content: this.replaceLiteralValueByUnicodeValue(nodeValue),
                     precedence: escodegen.Precedence.Primary
-                };
-                break;
-            default:
-                break;
+                },
+                type: NodeType_1.NodeType.Literal,
+                value: nodeValue
+            };
+            delete node.name;
+            Object.assign(node, literalNode);
         }
-    }
-}
+    }, {
+        key: 'literalNodeController',
+        value: function literalNodeController(node) {
+            switch (_typeof(node.value)) {
+                case 'string':
+                    if (node['x-verbatim-property']) {
+                        break;
+                    }
+                    node['x-verbatim-property'] = {
+                        content: this.replaceLiteralValueByUnicodeValue(node.value),
+                        precedence: escodegen.Precedence.Primary
+                    };
+                    break;
+                default:
+                    break;
+            }
+        }
+    }]);
+
+    return MemberExpressionObfuscator;
+}(NodeObfuscator_1.NodeObfuscator);
+
 exports.MemberExpressionObfuscator = MemberExpressionObfuscator;

+ 56 - 25
dist/src/node-obfuscators/MethodDefinitionObfuscator.js

@@ -1,29 +1,60 @@
 "use strict";
-const estraverse = require('estraverse');
-const NodeObfuscator_1 = require('./NodeObfuscator');
-const NodeUtils_1 = require("../NodeUtils");
-const Utils_1 = require("../Utils");
-class MethodDefinitionObfuscator extends NodeObfuscator_1.NodeObfuscator {
-    constructor(...args) {
-        super(...args);
-        this.ignoredNames = ['constructor'];
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var estraverse = require('estraverse');
+var NodeObfuscator_1 = require('./NodeObfuscator');
+var NodeUtils_1 = require("../NodeUtils");
+var Utils_1 = require("../Utils");
+
+var MethodDefinitionObfuscator = function (_NodeObfuscator_1$Nod) {
+    _inherits(MethodDefinitionObfuscator, _NodeObfuscator_1$Nod);
+
+    function MethodDefinitionObfuscator() {
+        var _Object$getPrototypeO;
+
+        _classCallCheck(this, MethodDefinitionObfuscator);
+
+        for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+            args[_key] = arguments[_key];
+        }
+
+        var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(MethodDefinitionObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
+
+        _this.ignoredNames = ['constructor'];
+        return _this;
     }
-    obfuscateNode(methodDefinitionNode, parentNode) {
-        this.replaceMethodName(methodDefinitionNode);
-    }
-    replaceMethodName(methodDefinitionNode) {
-        estraverse.replace(methodDefinitionNode.key, {
-            leave: (node) => {
-                if (NodeUtils_1.NodeUtils.isIdentifierNode(node) &&
-                    !Utils_1.Utils.arrayContains(this.ignoredNames, node.name) &&
-                    methodDefinitionNode.computed === false) {
-                    methodDefinitionNode.computed = true;
-                    node.name = this.replaceLiteralValueByUnicodeValue(node.name);
-                    return;
+
+    _createClass(MethodDefinitionObfuscator, [{
+        key: 'obfuscateNode',
+        value: function obfuscateNode(methodDefinitionNode, parentNode) {
+            this.replaceMethodName(methodDefinitionNode);
+        }
+    }, {
+        key: 'replaceMethodName',
+        value: function replaceMethodName(methodDefinitionNode) {
+            var _this2 = this;
+
+            estraverse.replace(methodDefinitionNode.key, {
+                leave: function leave(node) {
+                    if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !Utils_1.Utils.arrayContains(_this2.ignoredNames, node.name) && methodDefinitionNode.computed === false) {
+                        methodDefinitionNode.computed = true;
+                        node.name = _this2.replaceLiteralValueByUnicodeValue(node.name);
+                        return;
+                    }
+                    return estraverse.VisitorOption.Skip;
                 }
-                return estraverse.VisitorOption.Skip;
-            }
-        });
-    }
-}
+            });
+        }
+    }]);
+
+    return MethodDefinitionObfuscator;
+}(NodeObfuscator_1.NodeObfuscator);
+
 exports.MethodDefinitionObfuscator = MethodDefinitionObfuscator;

+ 82 - 53
dist/src/node-obfuscators/NodeObfuscator.js

@@ -1,64 +1,93 @@
 "use strict";
-const JSFuck_1 = require("../enums/JSFuck");
-const NodeUtils_1 = require("../NodeUtils");
-const Utils_1 = require('../Utils');
-class NodeObfuscator {
-    constructor(nodes, options = {}) {
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var JSFuck_1 = require("../enums/JSFuck");
+var NodeUtils_1 = require("../NodeUtils");
+var Utils_1 = require('../Utils');
+
+var NodeObfuscator = function () {
+    function NodeObfuscator(nodes) {
+        var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
+
+        _classCallCheck(this, NodeObfuscator);
+
         this.nodes = nodes;
         this.options = options;
     }
-    isReservedName(name) {
-        return this.options['reservedNames'].some((reservedName) => {
-            return new RegExp(reservedName, 'g').test(name);
-        });
-    }
-    replaceNodeIdentifierByNewValue(node, parentNode, namesMap) {
-        if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && namesMap.has(node.name)) {
-            const parentNodeIsAPropertyNode = (NodeUtils_1.NodeUtils.isPropertyNode(parentNode) &&
-                parentNode.key === node), parentNodeIsAMemberExpressionNode = (NodeUtils_1.NodeUtils.isMemberExpressionNode(parentNode) &&
-                parentNode.computed === false &&
-                parentNode.property === node);
-            if (parentNodeIsAPropertyNode || parentNodeIsAMemberExpressionNode) {
-                return;
-            }
-            node.name = namesMap.get(node.name);
+
+    _createClass(NodeObfuscator, [{
+        key: "isReservedName",
+        value: function isReservedName(name) {
+            return this.options['reservedNames'].some(function (reservedName) {
+                return new RegExp(reservedName, 'g').test(name);
+            });
         }
-    }
-    replaceLiteralBooleanByJSFuck(nodeValue) {
-        return nodeValue ? JSFuck_1.JSFuck.True : JSFuck_1.JSFuck.False;
-    }
-    replaceLiteralNumberByHexadecimalValue(nodeValue) {
-        const prefix = '0x';
-        if (!Utils_1.Utils.isInteger(nodeValue)) {
-            return String(nodeValue);
-        }
-        return `${prefix}${Utils_1.Utils.decToHex(nodeValue)}`;
-    }
-    replaceLiteralValueByUnicodeValue(nodeValue) {
-        let value = nodeValue, replaceByUnicodeArrayFlag = Math.random() <= this.options['unicodeArrayThreshold'];
-        if (this.options['encodeUnicodeLiterals'] && replaceByUnicodeArrayFlag) {
-            value = Utils_1.Utils.btoa(value);
+    }, {
+        key: "replaceNodeIdentifierByNewValue",
+        value: function replaceNodeIdentifierByNewValue(node, parentNode, namesMap) {
+            if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && namesMap.has(node.name)) {
+                var parentNodeIsAPropertyNode = NodeUtils_1.NodeUtils.isPropertyNode(parentNode) && parentNode.key === node,
+                    parentNodeIsAMemberExpressionNode = NodeUtils_1.NodeUtils.isMemberExpressionNode(parentNode) && parentNode.computed === false && parentNode.property === node;
+                if (parentNodeIsAPropertyNode || parentNodeIsAMemberExpressionNode) {
+                    return;
+                }
+                node.name = namesMap.get(node.name);
+            }
         }
-        value = Utils_1.Utils.stringToUnicode(value);
-        if (!this.options['unicodeArray'] || !replaceByUnicodeArrayFlag) {
-            return value;
+    }, {
+        key: "replaceLiteralBooleanByJSFuck",
+        value: function replaceLiteralBooleanByJSFuck(nodeValue) {
+            return nodeValue ? JSFuck_1.JSFuck.True : JSFuck_1.JSFuck.False;
         }
-        return this.replaceLiteralValueByUnicodeArrayCall(value);
-    }
-    replaceLiteralValueByUnicodeArrayCall(value) {
-        let unicodeArrayNode = this.nodes.get('unicodeArrayNode'), unicodeArray = unicodeArrayNode.getNodeData(), sameIndex = unicodeArray.indexOf(value), index, hexadecimalIndex;
-        if (sameIndex >= 0) {
-            index = sameIndex;
+    }, {
+        key: "replaceLiteralNumberByHexadecimalValue",
+        value: function replaceLiteralNumberByHexadecimalValue(nodeValue) {
+            var prefix = '0x';
+            if (!Utils_1.Utils.isInteger(nodeValue)) {
+                return String(nodeValue);
+            }
+            return "" + prefix + Utils_1.Utils.decToHex(nodeValue);
         }
-        else {
-            index = unicodeArray.length;
-            unicodeArrayNode.updateNodeData(value);
+    }, {
+        key: "replaceLiteralValueByUnicodeValue",
+        value: function replaceLiteralValueByUnicodeValue(nodeValue) {
+            var value = nodeValue,
+                replaceByUnicodeArrayFlag = Math.random() <= this.options['unicodeArrayThreshold'];
+            if (this.options['encodeUnicodeLiterals'] && replaceByUnicodeArrayFlag) {
+                value = Utils_1.Utils.btoa(value);
+            }
+            value = Utils_1.Utils.stringToUnicode(value);
+            if (!this.options['unicodeArray'] || !replaceByUnicodeArrayFlag) {
+                return value;
+            }
+            return this.replaceLiteralValueByUnicodeArrayCall(value);
         }
-        hexadecimalIndex = this.replaceLiteralNumberByHexadecimalValue(index);
-        if (this.options['wrapUnicodeArrayCalls']) {
-            return `${this.nodes.get('unicodeArrayCallsWrapper').getNodeIdentifier()}('${hexadecimalIndex}')`;
+    }, {
+        key: "replaceLiteralValueByUnicodeArrayCall",
+        value: function replaceLiteralValueByUnicodeArrayCall(value) {
+            var unicodeArrayNode = this.nodes.get('unicodeArrayNode'),
+                unicodeArray = unicodeArrayNode.getNodeData(),
+                sameIndex = unicodeArray.indexOf(value),
+                index = void 0,
+                hexadecimalIndex = void 0;
+            if (sameIndex >= 0) {
+                index = sameIndex;
+            } else {
+                index = unicodeArray.length;
+                unicodeArrayNode.updateNodeData(value);
+            }
+            hexadecimalIndex = this.replaceLiteralNumberByHexadecimalValue(index);
+            if (this.options['wrapUnicodeArrayCalls']) {
+                return this.nodes.get('unicodeArrayCallsWrapper').getNodeIdentifier() + "('" + hexadecimalIndex + "')";
+            }
+            return unicodeArrayNode.getNodeIdentifier() + "[" + hexadecimalIndex + "]";
         }
-        return `${unicodeArrayNode.getNodeIdentifier()}[${hexadecimalIndex}]`;
-    }
-}
+    }]);
+
+    return NodeObfuscator;
+}();
+
 exports.NodeObfuscator = NodeObfuscator;

+ 79 - 46
dist/src/node-obfuscators/ObjectExpressionObfuscator.js

@@ -1,53 +1,86 @@
 "use strict";
-const escodegen = require('escodegen');
-const estraverse = require('estraverse');
-const NodeType_1 = require("../enums/NodeType");
-const NodeObfuscator_1 = require('./NodeObfuscator');
-const NodeUtils_1 = require("../NodeUtils");
-const Utils_1 = require('../Utils');
-class ObjectExpressionObfuscator extends NodeObfuscator_1.NodeObfuscator {
-    obfuscateNode(objectExpressionNode) {
-        objectExpressionNode.properties.forEach((property) => {
-            estraverse.replace(property.key, {
-                leave: (node, parentNode) => {
-                    if (NodeUtils_1.NodeUtils.isLiteralNode(node)) {
-                        this.literalNodeController(node);
-                        return;
-                    }
-                    if (NodeUtils_1.NodeUtils.isIdentifierNode(node)) {
-                        this.identifierNodeController(node);
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var escodegen = require('escodegen');
+var estraverse = require('estraverse');
+var NodeType_1 = require("../enums/NodeType");
+var NodeObfuscator_1 = require('./NodeObfuscator');
+var NodeUtils_1 = require("../NodeUtils");
+var Utils_1 = require('../Utils');
+
+var ObjectExpressionObfuscator = function (_NodeObfuscator_1$Nod) {
+    _inherits(ObjectExpressionObfuscator, _NodeObfuscator_1$Nod);
+
+    function ObjectExpressionObfuscator() {
+        _classCallCheck(this, ObjectExpressionObfuscator);
+
+        return _possibleConstructorReturn(this, Object.getPrototypeOf(ObjectExpressionObfuscator).apply(this, arguments));
+    }
+
+    _createClass(ObjectExpressionObfuscator, [{
+        key: 'obfuscateNode',
+        value: function obfuscateNode(objectExpressionNode) {
+            var _this2 = this;
+
+            objectExpressionNode.properties.forEach(function (property) {
+                estraverse.replace(property.key, {
+                    leave: function leave(node, parentNode) {
+                        if (NodeUtils_1.NodeUtils.isLiteralNode(node)) {
+                            _this2.literalNodeController(node);
+                            return;
+                        }
+                        if (NodeUtils_1.NodeUtils.isIdentifierNode(node)) {
+                            _this2.identifierNodeController(node);
+                        }
                     }
-                }
+                });
             });
-        });
-    }
-    literalNodeController(node) {
-        switch (typeof node.value) {
-            case 'string':
-                if (node['x-verbatim-property']) {
+        }
+    }, {
+        key: 'literalNodeController',
+        value: function literalNodeController(node) {
+            switch (_typeof(node.value)) {
+                case 'string':
+                    if (node['x-verbatim-property']) {
+                        break;
+                    }
+                    node['x-verbatim-property'] = {
+                        content: Utils_1.Utils.stringToUnicode(node.value),
+                        precedence: escodegen.Precedence.Primary
+                    };
                     break;
-                }
-                node['x-verbatim-property'] = {
-                    content: Utils_1.Utils.stringToUnicode(node.value),
+                default:
+                    break;
+            }
+        }
+    }, {
+        key: 'identifierNodeController',
+        value: function identifierNodeController(node) {
+            var nodeValue = node.name,
+                literalNode = {
+                raw: '\'' + nodeValue + '\'',
+                'x-verbatim-property': {
+                    content: Utils_1.Utils.stringToUnicode(nodeValue),
                     precedence: escodegen.Precedence.Primary
-                };
-                break;
-            default:
-                break;
+                },
+                type: NodeType_1.NodeType.Literal,
+                value: nodeValue
+            };
+            delete node.name;
+            Object.assign(node, literalNode);
         }
-    }
-    identifierNodeController(node) {
-        let nodeValue = node.name, literalNode = {
-            raw: `'${nodeValue}'`,
-            'x-verbatim-property': {
-                content: Utils_1.Utils.stringToUnicode(nodeValue),
-                precedence: escodegen.Precedence.Primary
-            },
-            type: NodeType_1.NodeType.Literal,
-            value: nodeValue
-        };
-        delete node.name;
-        Object.assign(node, literalNode);
-    }
-}
+    }]);
+
+    return ObjectExpressionObfuscator;
+}(NodeObfuscator_1.NodeObfuscator);
+
 exports.ObjectExpressionObfuscator = ObjectExpressionObfuscator;

+ 87 - 54
dist/src/node-obfuscators/VariableDeclarationObfuscator.js

@@ -1,61 +1,94 @@
 "use strict";
-const estraverse = require('estraverse');
-const NodeType_1 = require("../enums/NodeType");
-const NodeObfuscator_1 = require('./NodeObfuscator');
-const NodeUtils_1 = require("../NodeUtils");
-const Utils_1 = require('../Utils');
-class VariableDeclarationObfuscator extends NodeObfuscator_1.NodeObfuscator {
-    constructor(...args) {
-        super(...args);
-        this.variableNames = new Map();
-    }
-    obfuscateNode(variableDeclarationNode, parentNode) {
-        if (parentNode.type === NodeType_1.NodeType.Program) {
-            return;
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var estraverse = require('estraverse');
+var NodeType_1 = require("../enums/NodeType");
+var NodeObfuscator_1 = require('./NodeObfuscator');
+var NodeUtils_1 = require("../NodeUtils");
+var Utils_1 = require('../Utils');
+
+var VariableDeclarationObfuscator = function (_NodeObfuscator_1$Nod) {
+    _inherits(VariableDeclarationObfuscator, _NodeObfuscator_1$Nod);
+
+    function VariableDeclarationObfuscator() {
+        var _Object$getPrototypeO;
+
+        _classCallCheck(this, VariableDeclarationObfuscator);
+
+        for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+            args[_key] = arguments[_key];
         }
-        this.replaceVariableName(variableDeclarationNode);
-        this.replaceVariableCalls(variableDeclarationNode, parentNode);
+
+        var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(VariableDeclarationObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
+
+        _this.variableNames = new Map();
+        return _this;
     }
-    replaceVariableName(variableDeclarationNode) {
-        variableDeclarationNode.declarations.forEach((declarationNode) => {
-            estraverse.replace(declarationNode.id, {
-                enter: (node) => {
-                    if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !this.isReservedName(node.name)) {
-                        this.variableNames.set(node.name, Utils_1.Utils.getRandomVariableName());
-                        node.name = this.variableNames.get(node.name);
-                        return;
+
+    _createClass(VariableDeclarationObfuscator, [{
+        key: "obfuscateNode",
+        value: function obfuscateNode(variableDeclarationNode, parentNode) {
+            if (parentNode.type === NodeType_1.NodeType.Program) {
+                return;
+            }
+            this.replaceVariableName(variableDeclarationNode);
+            this.replaceVariableCalls(variableDeclarationNode, parentNode);
+        }
+    }, {
+        key: "replaceVariableName",
+        value: function replaceVariableName(variableDeclarationNode) {
+            var _this2 = this;
+
+            variableDeclarationNode.declarations.forEach(function (declarationNode) {
+                estraverse.replace(declarationNode.id, {
+                    enter: function enter(node) {
+                        if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !_this2.isReservedName(node.name)) {
+                            _this2.variableNames.set(node.name, Utils_1.Utils.getRandomVariableName());
+                            node.name = _this2.variableNames.get(node.name);
+                            return;
+                        }
+                        return estraverse.VisitorOption.Skip;
                     }
-                    return estraverse.VisitorOption.Skip;
-                }
+                });
             });
-        });
-    }
-    replaceVariableCalls(variableDeclarationNode, variableParentNode) {
-        let scopeNode;
-        scopeNode = variableDeclarationNode.kind === 'var' ? NodeUtils_1.NodeUtils.getBlockScopeOfNode(variableDeclarationNode) : variableParentNode;
-        let isNodeAfterVariableDeclaratorFlag = false;
-        estraverse.replace(scopeNode, {
-            enter: (node, parentNode) => {
-                const functionNodes = [
-                    NodeType_1.NodeType.ArrowFunctionExpression,
-                    NodeType_1.NodeType.FunctionDeclaration,
-                    NodeType_1.NodeType.FunctionExpression
-                ];
-                if (Utils_1.Utils.arrayContains(functionNodes, node.type)) {
-                    estraverse.replace(node, {
-                        enter: (node, parentNode) => {
-                            this.replaceNodeIdentifierByNewValue(node, parentNode, this.variableNames);
-                        }
-                    });
-                }
-                if (node === variableDeclarationNode) {
-                    isNodeAfterVariableDeclaratorFlag = true;
-                }
-                if (isNodeAfterVariableDeclaratorFlag) {
-                    this.replaceNodeIdentifierByNewValue(node, parentNode, this.variableNames);
+        }
+    }, {
+        key: "replaceVariableCalls",
+        value: function replaceVariableCalls(variableDeclarationNode, variableParentNode) {
+            var _this3 = this;
+
+            var scopeNode = void 0;
+            scopeNode = variableDeclarationNode.kind === 'var' ? NodeUtils_1.NodeUtils.getBlockScopeOfNode(variableDeclarationNode) : variableParentNode;
+            var isNodeAfterVariableDeclaratorFlag = false;
+            estraverse.replace(scopeNode, {
+                enter: function enter(node, parentNode) {
+                    var functionNodes = [NodeType_1.NodeType.ArrowFunctionExpression, NodeType_1.NodeType.FunctionDeclaration, NodeType_1.NodeType.FunctionExpression];
+                    if (Utils_1.Utils.arrayContains(functionNodes, node.type)) {
+                        estraverse.replace(node, {
+                            enter: function enter(node, parentNode) {
+                                _this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.variableNames);
+                            }
+                        });
+                    }
+                    if (node === variableDeclarationNode) {
+                        isNodeAfterVariableDeclaratorFlag = true;
+                    }
+                    if (isNodeAfterVariableDeclaratorFlag) {
+                        _this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.variableNames);
+                    }
                 }
-            }
-        });
-    }
-}
+            });
+        }
+    }]);
+
+    return VariableDeclarationObfuscator;
+}(NodeObfuscator_1.NodeObfuscator);
+
 exports.VariableDeclarationObfuscator = VariableDeclarationObfuscator;

+ 1 - 0
dist/src/preset-options/DefaultPreset.js

@@ -1,4 +1,5 @@
 "use strict";
+
 exports.DEFAULT_PRESET = Object.freeze({
     compact: true,
     debugProtection: false,

+ 1 - 0
dist/src/preset-options/NoCustomNodesPreset.js

@@ -1,4 +1,5 @@
 "use strict";
+
 exports.NO_CUSTOM_NODES_PRESET = Object.freeze({
     compact: true,
     debugProtection: false,

+ 2 - 47
dist/tests/dev-test.js

@@ -1,52 +1,7 @@
 "use strict";
-const JavaScriptObfuscator_1 = require('../src/JavaScriptObfuscator');
-let obfuscatedCode = JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(`
-    (function(){
-        var result = 1,
-            term1 = 0,
-            term2 = 1,
-            i = 1;
-        while(i < 10)
-        {
-            var test = 10;
-            result = term1 + term2;
-            console.log(result);
-            term1 = term2;
-            term2 = result;
-            i++;
-        }
 
-        console.log(test);
-        
-        var test = function (test) {
-            console.log(test);
-            
-            if (true) {
-                var test = 5
-            }
-            
-            return test;
-        }
-        
-        console.log(test(1));
-        
-        function test2 (abc) {
-            function test1 () {
-              console.log('inside', abc.item);
-            }
-            
-            console.log('тест', abc);
-            
-            var abc = {};
-            
-            return abc.item = 15, test1();
-        };
-        
-        test2(22);
-        console.log(105.4);
-        console.log(true, false);
-    })();
-    `, {
+var JavaScriptObfuscator_1 = require('../src/JavaScriptObfuscator');
+var obfuscatedCode = JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate("\n    (function(){\n        var result = 1,\n            term1 = 0,\n            term2 = 1,\n            i = 1;\n        while(i < 10)\n        {\n            var test = 10;\n            result = term1 + term2;\n            console.log(result);\n            term1 = term2;\n            term2 = result;\n            i++;\n        }\n\n        console.log(test);\n        \n        var test = function (test) {\n            console.log(test);\n            \n            if (true) {\n                var test = 5\n            }\n            \n            return test;\n        }\n        \n        console.log(test(1));\n        \n        function test2 (abc) {\n            function test1 () {\n              console.log('inside', abc.item);\n            }\n            \n            console.log('тест', abc);\n            \n            var abc = {};\n            \n            return abc.item = 15, test1();\n        };\n        \n        test2(22);\n        console.log(105.4);\n        console.log(true, false);\n    })();\n    ", {
     disableConsoleOutput: false,
     encodeUnicodeLiterals: true
 });

+ 3 - 0
package.json

@@ -19,6 +19,9 @@
     "typescript": "^1.8.10"
   },
   "devDependencies": {
+    "babel-cli": "^6.9.0",
+    "babel-polyfill": "^6.9.1",
+    "babel-preset-es2015": "^6.9.0",
     "lite-server": "^1.3.1",
     "typings": "^0.8.1"
   },