瀏覽代碼

WIP: trying to remove some logic from node groups classes

sanex3339 4 年之前
父節點
當前提交
631cd9b3cf

File diff suppressed because it is too large
+ 0 - 0
dist/index.browser.js


File diff suppressed because it is too large
+ 0 - 0
dist/index.cli.js


File diff suppressed because it is too large
+ 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(

Some files were not shown because too many files changed in this diff