Pārlūkot izejas kodu

WIP: trying to remove some logic from node groups classes

sanex3339 4 gadi atpakaļ
vecāks
revīzija
631cd9b3cf

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/index.browser.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/index.cli.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/index.js


+ 2 - 5
src/custom-code-helpers/console-output/group/ConsoleOutputCodeHelperGroup.ts

@@ -22,7 +22,6 @@ import { CallsControllerFunctionCodeHelper } from '../../calls-controller/CallsC
 import { ConsoleOutputDisableCodeHelper } from '../ConsoleOutputDisableCodeHelper';
 import { NodeAppender } from '../../../node/NodeAppender';
 import { NodeLexicalScopeUtils } from '../../../node/NodeLexicalScopeUtils';
-import { NodeGuards } from '../../../node/NodeGuards';
 
 @injectable()
 export class ConsoleOutputCodeHelperGroup extends AbstractCustomCodeHelperGroup {
@@ -82,13 +81,11 @@ export class ConsoleOutputCodeHelperGroup extends AbstractCustomCodeHelperGroup
             .getLexicalScope(consoleOutputDisableHostNode) ?? null;
 
         const consoleOutputDisableFunctionName: string = consoleOutputDisableLexicalScopeNode
-            && NodeGuards.isProgramNode(consoleOutputDisableLexicalScopeNode)
             ? this.identifierNamesGenerator.generate(consoleOutputDisableLexicalScopeNode)
-            : this.randomGenerator.getRandomString(5);
+            : this.identifierNamesGenerator.generateNext();
         const callsControllerFunctionName: string = consoleOutputDisableLexicalScopeNode
-            && NodeGuards.isProgramNode(consoleOutputDisableLexicalScopeNode)
             ? this.identifierNamesGenerator.generate(consoleOutputDisableLexicalScopeNode)
-            : this.randomGenerator.getRandomString(5);
+            : this.identifierNamesGenerator.generateNext();
 
         // consoleOutputDisableExpression helper nodes append
         this.appendCustomNodeIfExist(

+ 2 - 4
src/custom-code-helpers/debug-protection/group/DebugProtectionCodeHelperGroup.ts

@@ -84,13 +84,11 @@ export class DebugProtectionCodeHelperGroup extends AbstractCustomCodeHelperGrou
             .getLexicalScope(debugProtectionFunctionCallHostNode) ?? null;
 
         const debugProtectionFunctionName: string = debugProtectionFunctionCallScopeNode
-            && NodeGuards.isProgramNode(debugProtectionFunctionCallScopeNode)
             ? this.identifierNamesGenerator.generate(debugProtectionFunctionCallScopeNode)
-            : this.randomGenerator.getRandomString(5);
+            : this.identifierNamesGenerator.generateNext();
         const callsControllerFunctionName: string = debugProtectionFunctionCallScopeNode
-            && NodeGuards.isProgramNode(debugProtectionFunctionCallScopeNode)
             ? this.identifierNamesGenerator.generate(debugProtectionFunctionCallScopeNode)
-            : this.randomGenerator.getRandomString(5);
+            : this.identifierNamesGenerator.generateNext();
 
         // debugProtectionFunctionCall helper nodes append
         this.appendCustomNodeIfExist(

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels