sanex3339 9 lat temu
rodzic
commit
27b9ae8e16

+ 2 - 10
dist/src/node-groups/DebugProtectionNodesGroup.js

@@ -8,16 +8,8 @@ class DebugProtectionNodesGroup extends NodesGroup_1.NodesGroup {
     constructor(options = {}) {
         super(options);
         this.debugProtectionFunctionIdentifier = Utils_1.Utils.getRandomVariableName();
-        this.nodes = new Map([
-            [
-                'debugProtectionFunctionNode',
-                new DebugProtectionFunctionNode_1.DebugProtectionFunctionNode(this.debugProtectionFunctionIdentifier)
-            ],
-            [
-                'debugProtectionFunctionCallNode',
-                new DebugProtectionFunctionCallNode_1.DebugProtectionFunctionCallNode(this.debugProtectionFunctionIdentifier)
-            ]
-        ]);
+        this.nodes.set('debugProtectionFunctionNode', new DebugProtectionFunctionNode_1.DebugProtectionFunctionNode(this.debugProtectionFunctionIdentifier));
+        this.nodes.set('debugProtectionFunctionCallNode', new DebugProtectionFunctionCallNode_1.DebugProtectionFunctionCallNode(this.debugProtectionFunctionIdentifier));
         if (this.options['debugProtectionInterval']) {
             this.nodes.set('debugProtectionFunctionIntervalNode', new DebugProtectionFunctionIntervalNode_1.DebugProtectionFunctionIntervalNode(this.debugProtectionFunctionIdentifier));
         }

+ 1 - 0
dist/src/node-groups/NodesGroup.js

@@ -1,6 +1,7 @@
 "use strict";
 class NodesGroup {
     constructor(options = {}) {
+        this.nodes = new Map();
         this.options = options;
     }
     getNodes() {

+ 1 - 6
dist/src/node-groups/UnicodeArrayNodesGroup.js

@@ -11,12 +11,7 @@ class UnicodeArrayNodesGroup extends NodesGroup_1.NodesGroup {
         this.unicodeArrayRotateValue = Utils_1.Utils.getRandomInteger(100, 500);
         this.unicodeArrayTranslatorName = Utils_1.Utils.getRandomVariableName(UnicodeArrayNode_1.UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
         let unicodeArrayNode = new UnicodeArrayNode_1.UnicodeArrayNode(this.unicodeArrayName, this.unicodeArrayRotateValue), unicodeArray = unicodeArrayNode.getNodeData();
-        this.nodes = new Map([
-            [
-                'unicodeArrayNode',
-                unicodeArrayNode
-            ]
-        ]);
+        this.nodes.set('unicodeArrayNode', unicodeArrayNode);
         if (this.options['wrapUnicodeArrayCalls']) {
             this.nodes.set('unicodeArrayCallsWrapper', new UnicodeArrayCallsWrapper_1.UnicodeArrayCallsWrapper(this.unicodeArrayTranslatorName, this.unicodeArrayName, unicodeArray));
         }

+ 8 - 10
src/node-groups/DebugProtectionNodesGroup.ts

@@ -20,16 +20,14 @@ export class DebugProtectionNodesGroup extends NodesGroup {
     constructor (options: IOptions = {}) {
         super(options);
 
-        this.nodes = new Map <string, ICustomNode> ([
-            [
-                'debugProtectionFunctionNode',
-                new DebugProtectionFunctionNode(this.debugProtectionFunctionIdentifier)
-            ],
-            [
-                'debugProtectionFunctionCallNode',
-                new DebugProtectionFunctionCallNode(this.debugProtectionFunctionIdentifier)
-            ]
-        ]);
+        this.nodes.set(
+            'debugProtectionFunctionNode',
+            new DebugProtectionFunctionNode(this.debugProtectionFunctionIdentifier)
+        );
+        this.nodes.set(
+            'debugProtectionFunctionCallNode',
+            new DebugProtectionFunctionCallNode(this.debugProtectionFunctionIdentifier)
+        );
 
         if (this.options['debugProtectionInterval']) {
             this.nodes.set(

+ 1 - 1
src/node-groups/NodesGroup.ts

@@ -7,7 +7,7 @@ export abstract class NodesGroup implements INodesGroup {
     /**
      * @type {Map<string, Node>}
      */
-    protected nodes: Map <string, ICustomNode>;
+    protected nodes: Map <string, ICustomNode> = new Map <string, ICustomNode> ();
 
     /**
      * @type {IOptions}

+ 4 - 6
src/node-groups/UnicodeArrayNodesGroup.ts

@@ -35,12 +35,10 @@ export class UnicodeArrayNodesGroup extends NodesGroup {
             ),
             unicodeArray: string [] = unicodeArrayNode.getNodeData();
 
-        this.nodes = new Map <string, ICustomNode> ([
-            [
-                'unicodeArrayNode',
-                unicodeArrayNode
-            ]
-        ]);
+        this.nodes.set(
+            'unicodeArrayNode',
+            unicodeArrayNode
+        );
 
         if (this.options['wrapUnicodeArrayCalls']) {
             this.nodes.set(