@grafema/core 0.2.5-beta → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -23
- package/dist/DiscoveryManager.d.ts +59 -0
- package/dist/DiscoveryManager.d.ts.map +1 -0
- package/dist/DiscoveryManager.js +249 -0
- package/dist/DiscoveryManager.js.map +1 -0
- package/dist/GraphInitializer.d.ts +44 -0
- package/dist/GraphInitializer.d.ts.map +1 -0
- package/dist/GraphInitializer.js +121 -0
- package/dist/GraphInitializer.js.map +1 -0
- package/dist/GuaranteeChecker.d.ts +35 -0
- package/dist/GuaranteeChecker.d.ts.map +1 -0
- package/dist/GuaranteeChecker.js +81 -0
- package/dist/GuaranteeChecker.js.map +1 -0
- package/dist/Orchestrator.d.ts +34 -151
- package/dist/Orchestrator.d.ts.map +1 -1
- package/dist/Orchestrator.js +173 -741
- package/dist/Orchestrator.js.map +1 -1
- package/dist/OrchestratorTypes.d.ts +115 -0
- package/dist/OrchestratorTypes.d.ts.map +1 -0
- package/dist/OrchestratorTypes.js +6 -0
- package/dist/OrchestratorTypes.js.map +1 -0
- package/dist/ParallelAnalysisRunner.d.ts +43 -0
- package/dist/ParallelAnalysisRunner.d.ts.map +1 -0
- package/dist/ParallelAnalysisRunner.js +161 -0
- package/dist/ParallelAnalysisRunner.js.map +1 -0
- package/dist/PhaseRunner.d.ts +94 -0
- package/dist/PhaseRunner.d.ts.map +1 -0
- package/dist/PhaseRunner.js +332 -0
- package/dist/PhaseRunner.js.map +1 -0
- package/dist/config/ConfigLoader.d.ts +51 -1
- package/dist/config/ConfigLoader.d.ts.map +1 -1
- package/dist/config/ConfigLoader.js +121 -1
- package/dist/config/ConfigLoader.js.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/index.js.map +1 -1
- package/dist/core/ASTWorker.d.ts +2 -0
- package/dist/core/ASTWorker.d.ts.map +1 -1
- package/dist/core/ASTWorker.js +6 -2
- package/dist/core/ASTWorker.js.map +1 -1
- package/dist/core/FileOverview.d.ts +124 -0
- package/dist/core/FileOverview.d.ts.map +1 -0
- package/dist/core/FileOverview.js +257 -0
- package/dist/core/FileOverview.js.map +1 -0
- package/dist/core/GraphFreshnessChecker.d.ts +1 -1
- package/dist/core/GraphFreshnessChecker.d.ts.map +1 -1
- package/dist/core/GraphFreshnessChecker.js +7 -5
- package/dist/core/GraphFreshnessChecker.js.map +1 -1
- package/dist/core/GuaranteeManager.d.ts +13 -0
- package/dist/core/GuaranteeManager.d.ts.map +1 -1
- package/dist/core/GuaranteeManager.js +63 -2
- package/dist/core/GuaranteeManager.js.map +1 -1
- package/dist/core/IncrementalReanalyzer.d.ts.map +1 -1
- package/dist/core/IncrementalReanalyzer.js +6 -3
- package/dist/core/IncrementalReanalyzer.js.map +1 -1
- package/dist/core/NodeFactory.d.ts +81 -415
- package/dist/core/NodeFactory.d.ts.map +1 -1
- package/dist/core/NodeFactory.js +139 -336
- package/dist/core/NodeFactory.js.map +1 -1
- package/dist/core/ResourceRegistry.d.ts +17 -0
- package/dist/core/ResourceRegistry.d.ts.map +1 -0
- package/dist/core/ResourceRegistry.js +32 -0
- package/dist/core/ResourceRegistry.js.map +1 -0
- package/dist/core/ScopeTracker.d.ts +12 -0
- package/dist/core/ScopeTracker.d.ts.map +1 -1
- package/dist/core/ScopeTracker.js +24 -0
- package/dist/core/ScopeTracker.js.map +1 -1
- package/dist/core/SemanticId.d.ts +69 -0
- package/dist/core/SemanticId.d.ts.map +1 -1
- package/dist/core/SemanticId.js +134 -0
- package/dist/core/SemanticId.js.map +1 -1
- package/dist/core/brandNodeInternal.d.ts +14 -0
- package/dist/core/brandNodeInternal.d.ts.map +1 -0
- package/dist/core/brandNodeInternal.js +4 -0
- package/dist/core/brandNodeInternal.js.map +1 -0
- package/dist/core/buildDependencyGraph.d.ts +36 -0
- package/dist/core/buildDependencyGraph.d.ts.map +1 -0
- package/dist/core/buildDependencyGraph.js +78 -0
- package/dist/core/buildDependencyGraph.js.map +1 -0
- package/dist/core/factories/CoreFactory.d.ts +223 -0
- package/dist/core/factories/CoreFactory.d.ts.map +1 -0
- package/dist/core/factories/CoreFactory.js +127 -0
- package/dist/core/factories/CoreFactory.js.map +1 -0
- package/dist/core/factories/DatabaseFactory.d.ts +29 -0
- package/dist/core/factories/DatabaseFactory.d.ts.map +1 -0
- package/dist/core/factories/DatabaseFactory.js +25 -0
- package/dist/core/factories/DatabaseFactory.js.map +1 -0
- package/dist/core/factories/ExternalFactory.d.ts +11 -0
- package/dist/core/factories/ExternalFactory.d.ts.map +1 -0
- package/dist/core/factories/ExternalFactory.js +16 -0
- package/dist/core/factories/ExternalFactory.js.map +1 -0
- package/dist/core/factories/HttpFactory.d.ts +22 -0
- package/dist/core/factories/HttpFactory.d.ts.map +1 -0
- package/dist/core/factories/HttpFactory.js +32 -0
- package/dist/core/factories/HttpFactory.js.map +1 -0
- package/dist/core/factories/ReactFactory.d.ts +14 -0
- package/dist/core/factories/ReactFactory.d.ts.map +1 -0
- package/dist/core/factories/ReactFactory.js +13 -0
- package/dist/core/factories/ReactFactory.js.map +1 -0
- package/dist/core/factories/RustFactory.d.ts +62 -0
- package/dist/core/factories/RustFactory.d.ts.map +1 -0
- package/dist/core/factories/RustFactory.js +32 -0
- package/dist/core/factories/RustFactory.js.map +1 -0
- package/dist/core/factories/ServiceFactory.d.ts +12 -0
- package/dist/core/factories/ServiceFactory.d.ts.map +1 -0
- package/dist/core/factories/ServiceFactory.js +22 -0
- package/dist/core/factories/ServiceFactory.js.map +1 -0
- package/dist/core/factories/SocketFactory.d.ts +31 -0
- package/dist/core/factories/SocketFactory.d.ts.map +1 -0
- package/dist/core/factories/SocketFactory.js +35 -0
- package/dist/core/factories/SocketFactory.js.map +1 -0
- package/dist/core/nodes/DatabaseNode.d.ts +85 -0
- package/dist/core/nodes/DatabaseNode.d.ts.map +1 -0
- package/dist/core/nodes/DatabaseNode.js +118 -0
- package/dist/core/nodes/DatabaseNode.js.map +1 -0
- package/dist/core/nodes/ExpressMiddlewareNode.d.ts +47 -0
- package/dist/core/nodes/ExpressMiddlewareNode.d.ts.map +1 -0
- package/dist/core/nodes/ExpressMiddlewareNode.js +63 -0
- package/dist/core/nodes/ExpressMiddlewareNode.js.map +1 -0
- package/dist/core/nodes/ExpressMountNode.d.ts +44 -0
- package/dist/core/nodes/ExpressMountNode.d.ts.map +1 -0
- package/dist/core/nodes/ExpressMountNode.js +61 -0
- package/dist/core/nodes/ExpressMountNode.js.map +1 -0
- package/dist/core/nodes/ExternalApiNode.d.ts +29 -0
- package/dist/core/nodes/ExternalApiNode.d.ts.map +1 -0
- package/dist/core/nodes/ExternalApiNode.js +41 -0
- package/dist/core/nodes/ExternalApiNode.js.map +1 -0
- package/dist/core/nodes/ExternalFunctionNode.d.ts +40 -0
- package/dist/core/nodes/ExternalFunctionNode.d.ts.map +1 -0
- package/dist/core/nodes/ExternalFunctionNode.js +54 -0
- package/dist/core/nodes/ExternalFunctionNode.js.map +1 -0
- package/dist/core/nodes/FetchRequestNode.d.ts +54 -0
- package/dist/core/nodes/FetchRequestNode.d.ts.map +1 -0
- package/dist/core/nodes/FetchRequestNode.js +67 -0
- package/dist/core/nodes/FetchRequestNode.js.map +1 -0
- package/dist/core/nodes/HttpRouteNode.d.ts +58 -0
- package/dist/core/nodes/HttpRouteNode.d.ts.map +1 -0
- package/dist/core/nodes/HttpRouteNode.js +72 -0
- package/dist/core/nodes/HttpRouteNode.js.map +1 -0
- package/dist/core/nodes/NodeKind.d.ts +1 -0
- package/dist/core/nodes/NodeKind.d.ts.map +1 -1
- package/dist/core/nodes/NodeKind.js +1 -0
- package/dist/core/nodes/NodeKind.js.map +1 -1
- package/dist/core/nodes/ReactNode.d.ts +53 -0
- package/dist/core/nodes/ReactNode.d.ts.map +1 -0
- package/dist/core/nodes/ReactNode.js +70 -0
- package/dist/core/nodes/ReactNode.js.map +1 -0
- package/dist/core/nodes/RustCallNode.d.ts +46 -0
- package/dist/core/nodes/RustCallNode.d.ts.map +1 -0
- package/dist/core/nodes/RustCallNode.js +62 -0
- package/dist/core/nodes/RustCallNode.js.map +1 -0
- package/dist/core/nodes/RustFunctionNode.d.ts +58 -0
- package/dist/core/nodes/RustFunctionNode.d.ts.map +1 -0
- package/dist/core/nodes/RustFunctionNode.js +67 -0
- package/dist/core/nodes/RustFunctionNode.js.map +1 -0
- package/dist/core/nodes/RustImplNode.d.ts +35 -0
- package/dist/core/nodes/RustImplNode.d.ts.map +1 -0
- package/dist/core/nodes/RustImplNode.js +55 -0
- package/dist/core/nodes/RustImplNode.js.map +1 -0
- package/dist/core/nodes/RustMethodNode.d.ts +64 -0
- package/dist/core/nodes/RustMethodNode.d.ts.map +1 -0
- package/dist/core/nodes/RustMethodNode.js +76 -0
- package/dist/core/nodes/RustMethodNode.js.map +1 -0
- package/dist/core/nodes/RustModuleNode.d.ts +40 -0
- package/dist/core/nodes/RustModuleNode.d.ts.map +1 -0
- package/dist/core/nodes/RustModuleNode.js +57 -0
- package/dist/core/nodes/RustModuleNode.js.map +1 -0
- package/dist/core/nodes/RustStructNode.d.ts +38 -0
- package/dist/core/nodes/RustStructNode.d.ts.map +1 -0
- package/dist/core/nodes/RustStructNode.js +54 -0
- package/dist/core/nodes/RustStructNode.js.map +1 -0
- package/dist/core/nodes/RustTraitNode.d.ts +40 -0
- package/dist/core/nodes/RustTraitNode.d.ts.map +1 -0
- package/dist/core/nodes/RustTraitNode.js +52 -0
- package/dist/core/nodes/RustTraitNode.js.map +1 -0
- package/dist/core/nodes/ServiceLayerNode.d.ts +85 -0
- package/dist/core/nodes/ServiceLayerNode.d.ts.map +1 -0
- package/dist/core/nodes/ServiceLayerNode.js +122 -0
- package/dist/core/nodes/ServiceLayerNode.js.map +1 -0
- package/dist/core/nodes/SocketIONode.d.ts +71 -0
- package/dist/core/nodes/SocketIONode.d.ts.map +1 -0
- package/dist/core/nodes/SocketIONode.js +111 -0
- package/dist/core/nodes/SocketIONode.js.map +1 -0
- package/dist/core/nodes/SocketNode.d.ts +87 -0
- package/dist/core/nodes/SocketNode.d.ts.map +1 -0
- package/dist/core/nodes/SocketNode.js +124 -0
- package/dist/core/nodes/SocketNode.js.map +1 -0
- package/dist/core/nodes/TypeNode.d.ts +26 -1
- package/dist/core/nodes/TypeNode.d.ts.map +1 -1
- package/dist/core/nodes/TypeNode.js +21 -3
- package/dist/core/nodes/TypeNode.js.map +1 -1
- package/dist/core/nodes/TypeParameterNode.d.ts +44 -0
- package/dist/core/nodes/TypeParameterNode.d.ts.map +1 -0
- package/dist/core/nodes/TypeParameterNode.js +64 -0
- package/dist/core/nodes/TypeParameterNode.js.map +1 -0
- package/dist/core/nodes/index.d.ts +19 -0
- package/dist/core/nodes/index.d.ts.map +1 -1
- package/dist/core/nodes/index.js +26 -0
- package/dist/core/nodes/index.js.map +1 -1
- package/dist/index.d.ts +33 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -3
- package/dist/index.js.map +1 -1
- package/dist/plugins/InfraAnalyzer.d.ts +110 -0
- package/dist/plugins/InfraAnalyzer.d.ts.map +1 -0
- package/dist/plugins/InfraAnalyzer.js +170 -0
- package/dist/plugins/InfraAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/DatabaseAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/DatabaseAnalyzer.js +18 -15
- package/dist/plugins/analysis/DatabaseAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/ExpressAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressAnalyzer.js +27 -26
- package/dist/plugins/analysis/ExpressAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressResponseAnalyzer.js +5 -3
- package/dist/plugins/analysis/ExpressResponseAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/ExpressRouteAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressRouteAnalyzer.js +36 -39
- package/dist/plugins/analysis/ExpressRouteAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/FetchAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/FetchAnalyzer.js +23 -39
- package/dist/plugins/analysis/FetchAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.d.ts.map +1 -1
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.js +3 -2
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.js.map +1 -1
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts +23 -85
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/JSASTAnalyzer.js +351 -1887
- package/dist/plugins/analysis/JSASTAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/NestJSRouteAnalyzer.d.ts +28 -0
- package/dist/plugins/analysis/NestJSRouteAnalyzer.d.ts.map +1 -0
- package/dist/plugins/analysis/NestJSRouteAnalyzer.js +196 -0
- package/dist/plugins/analysis/NestJSRouteAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ReactAnalyzer.d.ts +1 -61
- package/dist/plugins/analysis/ReactAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ReactAnalyzer.js +24 -915
- package/dist/plugins/analysis/ReactAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/RustAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/RustAnalyzer.js +31 -66
- package/dist/plugins/analysis/RustAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/SQLiteAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SQLiteAnalyzer.js +13 -6
- package/dist/plugins/analysis/SQLiteAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/ServiceLayerAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ServiceLayerAnalyzer.js +10 -7
- package/dist/plugins/analysis/ServiceLayerAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/SocketAnalyzer.d.ts +81 -0
- package/dist/plugins/analysis/SocketAnalyzer.d.ts.map +1 -0
- package/dist/plugins/analysis/SocketAnalyzer.js +475 -0
- package/dist/plugins/analysis/SocketAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/SocketIOAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SocketIOAnalyzer.js +13 -18
- package/dist/plugins/analysis/SocketIOAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/SystemDbAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SystemDbAnalyzer.js +8 -5
- package/dist/plugins/analysis/SystemDbAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/ast/CollisionResolver.d.ts +65 -0
- package/dist/plugins/analysis/ast/CollisionResolver.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/CollisionResolver.js +106 -0
- package/dist/plugins/analysis/ast/CollisionResolver.js.map +1 -0
- package/dist/plugins/analysis/ast/FunctionBodyContext.d.ts +124 -0
- package/dist/plugins/analysis/ast/FunctionBodyContext.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/FunctionBodyContext.js +151 -0
- package/dist/plugins/analysis/ast/FunctionBodyContext.js.map +1 -0
- package/dist/plugins/analysis/ast/GraphBuilder.d.ts +26 -261
- package/dist/plugins/analysis/ast/GraphBuilder.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/GraphBuilder.js +251 -2494
- package/dist/plugins/analysis/ast/GraphBuilder.js.map +1 -1
- package/dist/plugins/analysis/ast/IdGenerator.d.ts +42 -0
- package/dist/plugins/analysis/ast/IdGenerator.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/IdGenerator.js +61 -1
- package/dist/plugins/analysis/ast/IdGenerator.js.map +1 -1
- package/dist/plugins/analysis/ast/builders/AssignmentBuilder.d.ts +15 -0
- package/dist/plugins/analysis/ast/builders/AssignmentBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/AssignmentBuilder.js +274 -0
- package/dist/plugins/analysis/ast/builders/AssignmentBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/CallFlowBuilder.d.ts +22 -0
- package/dist/plugins/analysis/ast/builders/CallFlowBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/CallFlowBuilder.js +178 -0
- package/dist/plugins/analysis/ast/builders/CallFlowBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/ControlFlowBuilder.d.ts +76 -0
- package/dist/plugins/analysis/ast/builders/ControlFlowBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/ControlFlowBuilder.js +387 -0
- package/dist/plugins/analysis/ast/builders/ControlFlowBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/CoreBuilder.d.ts +38 -0
- package/dist/plugins/analysis/ast/builders/CoreBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/CoreBuilder.js +240 -0
- package/dist/plugins/analysis/ast/builders/CoreBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/ModuleRuntimeBuilder.d.ts +53 -0
- package/dist/plugins/analysis/ast/builders/ModuleRuntimeBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/ModuleRuntimeBuilder.js +355 -0
- package/dist/plugins/analysis/ast/builders/ModuleRuntimeBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/MutationBuilder.d.ts +46 -0
- package/dist/plugins/analysis/ast/builders/MutationBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/MutationBuilder.js +264 -0
- package/dist/plugins/analysis/ast/builders/MutationBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/ReturnBuilder.d.ts +23 -0
- package/dist/plugins/analysis/ast/builders/ReturnBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/ReturnBuilder.js +206 -0
- package/dist/plugins/analysis/ast/builders/ReturnBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/TypeSystemBuilder.d.ts +64 -0
- package/dist/plugins/analysis/ast/builders/TypeSystemBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/TypeSystemBuilder.js +370 -0
- package/dist/plugins/analysis/ast/builders/TypeSystemBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/UpdateExpressionBuilder.d.ts +46 -0
- package/dist/plugins/analysis/ast/builders/UpdateExpressionBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/UpdateExpressionBuilder.js +191 -0
- package/dist/plugins/analysis/ast/builders/UpdateExpressionBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/YieldBuilder.d.ts +30 -0
- package/dist/plugins/analysis/ast/builders/YieldBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/YieldBuilder.js +214 -0
- package/dist/plugins/analysis/ast/builders/YieldBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/index.d.ts +12 -0
- package/dist/plugins/analysis/ast/builders/index.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/index.js +11 -0
- package/dist/plugins/analysis/ast/builders/index.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/types.d.ts +30 -0
- package/dist/plugins/analysis/ast/builders/types.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/types.js +8 -0
- package/dist/plugins/analysis/ast/builders/types.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/AnalyzerDelegate.d.ts +50 -0
- package/dist/plugins/analysis/ast/handlers/AnalyzerDelegate.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/AnalyzerDelegate.js +2 -0
- package/dist/plugins/analysis/ast/handlers/AnalyzerDelegate.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/BranchHandler.d.ts +18 -0
- package/dist/plugins/analysis/ast/handlers/BranchHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/BranchHandler.js +244 -0
- package/dist/plugins/analysis/ast/handlers/BranchHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/CallExpressionHandler.d.ts +7 -0
- package/dist/plugins/analysis/ast/handlers/CallExpressionHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/CallExpressionHandler.js +295 -0
- package/dist/plugins/analysis/ast/handlers/CallExpressionHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/FunctionBodyHandler.d.ts +22 -0
- package/dist/plugins/analysis/ast/handlers/FunctionBodyHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/FunctionBodyHandler.js +9 -0
- package/dist/plugins/analysis/ast/handlers/FunctionBodyHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/LoopHandler.d.ts +13 -0
- package/dist/plugins/analysis/ast/handlers/LoopHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/LoopHandler.js +207 -0
- package/dist/plugins/analysis/ast/handlers/LoopHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/NestedFunctionHandler.d.ts +13 -0
- package/dist/plugins/analysis/ast/handlers/NestedFunctionHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/NestedFunctionHandler.js +174 -0
- package/dist/plugins/analysis/ast/handlers/NestedFunctionHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/NewExpressionHandler.d.ts +12 -0
- package/dist/plugins/analysis/ast/handlers/NewExpressionHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/NewExpressionHandler.js +135 -0
- package/dist/plugins/analysis/ast/handlers/NewExpressionHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/PropertyAccessHandler.d.ts +13 -0
- package/dist/plugins/analysis/ast/handlers/PropertyAccessHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/PropertyAccessHandler.js +71 -0
- package/dist/plugins/analysis/ast/handlers/PropertyAccessHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/ReturnYieldHandler.d.ts +12 -0
- package/dist/plugins/analysis/ast/handlers/ReturnYieldHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/ReturnYieldHandler.js +135 -0
- package/dist/plugins/analysis/ast/handlers/ReturnYieldHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/ThrowHandler.d.ts +12 -0
- package/dist/plugins/analysis/ast/handlers/ThrowHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/ThrowHandler.js +82 -0
- package/dist/plugins/analysis/ast/handlers/ThrowHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/TryCatchHandler.d.ts +14 -0
- package/dist/plugins/analysis/ast/handlers/TryCatchHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/TryCatchHandler.js +220 -0
- package/dist/plugins/analysis/ast/handlers/TryCatchHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/VariableHandler.d.ts +12 -0
- package/dist/plugins/analysis/ast/handlers/VariableHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/VariableHandler.js +57 -0
- package/dist/plugins/analysis/ast/handlers/VariableHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/index.d.ts +13 -0
- package/dist/plugins/analysis/ast/handlers/index.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/index.js +12 -0
- package/dist/plugins/analysis/ast/handlers/index.js.map +1 -0
- package/dist/plugins/analysis/ast/types.d.ts +57 -6
- package/dist/plugins/analysis/ast/types.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/utils/createParameterNodes.d.ts +5 -4
- package/dist/plugins/analysis/ast/utils/createParameterNodes.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/utils/createParameterNodes.js +94 -13
- package/dist/plugins/analysis/ast/utils/createParameterNodes.js.map +1 -1
- package/dist/plugins/analysis/ast/utils/extractNamesFromPattern.d.ts +81 -0
- package/dist/plugins/analysis/ast/utils/extractNamesFromPattern.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/utils/extractNamesFromPattern.js +140 -0
- package/dist/plugins/analysis/ast/utils/extractNamesFromPattern.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/getExpressionValue.d.ts +22 -0
- package/dist/plugins/analysis/ast/utils/getExpressionValue.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/utils/getExpressionValue.js +35 -0
- package/dist/plugins/analysis/ast/utils/getExpressionValue.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/getMemberExpressionName.d.ts +25 -0
- package/dist/plugins/analysis/ast/utils/getMemberExpressionName.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/utils/getMemberExpressionName.js +21 -0
- package/dist/plugins/analysis/ast/utils/getMemberExpressionName.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/index.d.ts +2 -0
- package/dist/plugins/analysis/ast/utils/index.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/utils/index.js +2 -0
- package/dist/plugins/analysis/ast/utils/index.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ArgumentExtractor.d.ts +23 -0
- package/dist/plugins/analysis/ast/visitors/ArgumentExtractor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ArgumentExtractor.js +241 -0
- package/dist/plugins/analysis/ast/visitors/ArgumentExtractor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ArrayElementExtractor.d.ts +20 -0
- package/dist/plugins/analysis/ast/visitors/ArrayElementExtractor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ArrayElementExtractor.js +110 -0
- package/dist/plugins/analysis/ast/visitors/ArrayElementExtractor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts +15 -142
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js +304 -937
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.js +26 -11
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js +21 -6
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/MutationDetector.d.ts +25 -0
- package/dist/plugins/analysis/ast/visitors/MutationDetector.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/MutationDetector.js +181 -0
- package/dist/plugins/analysis/ast/visitors/MutationDetector.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ObjectPropertyExtractor.d.ts +20 -0
- package/dist/plugins/analysis/ast/visitors/ObjectPropertyExtractor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ObjectPropertyExtractor.js +155 -0
- package/dist/plugins/analysis/ast/visitors/ObjectPropertyExtractor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.d.ts +9 -1
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.js +51 -3
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts +20 -0
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.js +188 -12
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.js +6 -4
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/call-expression-helpers.d.ts +19 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-helpers.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-helpers.js +57 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-helpers.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-types.d.ts +168 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-types.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-types.js +7 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-types.js.map +1 -0
- package/dist/plugins/analysis/react-internal/browser-api.d.ts +20 -0
- package/dist/plugins/analysis/react-internal/browser-api.d.ts.map +1 -0
- package/dist/plugins/analysis/react-internal/browser-api.js +140 -0
- package/dist/plugins/analysis/react-internal/browser-api.js.map +1 -0
- package/dist/plugins/analysis/react-internal/hooks.d.ts +31 -0
- package/dist/plugins/analysis/react-internal/hooks.d.ts.map +1 -0
- package/dist/plugins/analysis/react-internal/hooks.js +465 -0
- package/dist/plugins/analysis/react-internal/hooks.js.map +1 -0
- package/dist/plugins/analysis/react-internal/jsx.d.ts +43 -0
- package/dist/plugins/analysis/react-internal/jsx.d.ts.map +1 -0
- package/dist/plugins/analysis/react-internal/jsx.js +231 -0
- package/dist/plugins/analysis/react-internal/jsx.js.map +1 -0
- package/dist/plugins/analysis/react-internal/types.d.ts +116 -0
- package/dist/plugins/analysis/react-internal/types.d.ts.map +1 -0
- package/dist/plugins/analysis/react-internal/types.js +83 -0
- package/dist/plugins/analysis/react-internal/types.js.map +1 -0
- package/dist/plugins/discovery/MonorepoServiceDiscovery.d.ts.map +1 -1
- package/dist/plugins/discovery/MonorepoServiceDiscovery.js +6 -13
- package/dist/plugins/discovery/MonorepoServiceDiscovery.js.map +1 -1
- package/dist/plugins/enrichment/AliasTracker.d.ts.map +1 -1
- package/dist/plugins/enrichment/AliasTracker.js +3 -1
- package/dist/plugins/enrichment/AliasTracker.js.map +1 -1
- package/dist/plugins/enrichment/ArgumentParameterLinker.d.ts.map +1 -1
- package/dist/plugins/enrichment/ArgumentParameterLinker.js +3 -1
- package/dist/plugins/enrichment/ArgumentParameterLinker.js.map +1 -1
- package/dist/plugins/enrichment/CallbackCallResolver.d.ts +42 -0
- package/dist/plugins/enrichment/CallbackCallResolver.d.ts.map +1 -0
- package/dist/plugins/enrichment/CallbackCallResolver.js +311 -0
- package/dist/plugins/enrichment/CallbackCallResolver.js.map +1 -0
- package/dist/plugins/enrichment/ClosureCaptureEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/ClosureCaptureEnricher.js +3 -1
- package/dist/plugins/enrichment/ClosureCaptureEnricher.js.map +1 -1
- package/dist/plugins/enrichment/ConfigRoutingMapBuilder.d.ts +17 -0
- package/dist/plugins/enrichment/ConfigRoutingMapBuilder.d.ts.map +1 -0
- package/dist/plugins/enrichment/ConfigRoutingMapBuilder.js +55 -0
- package/dist/plugins/enrichment/ConfigRoutingMapBuilder.js.map +1 -0
- package/dist/plugins/enrichment/ExpressHandlerLinker.d.ts.map +1 -1
- package/dist/plugins/enrichment/ExpressHandlerLinker.js +3 -1
- package/dist/plugins/enrichment/ExpressHandlerLinker.js.map +1 -1
- package/dist/plugins/enrichment/ExternalCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/ExternalCallResolver.js +5 -8
- package/dist/plugins/enrichment/ExternalCallResolver.js.map +1 -1
- package/dist/plugins/enrichment/FunctionCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/FunctionCallResolver.js +6 -9
- package/dist/plugins/enrichment/FunctionCallResolver.js.map +1 -1
- package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/HTTPConnectionEnricher.js +3 -1
- package/dist/plugins/enrichment/HTTPConnectionEnricher.js.map +1 -1
- package/dist/plugins/enrichment/ImportExportLinker.d.ts.map +1 -1
- package/dist/plugins/enrichment/ImportExportLinker.js +5 -3
- package/dist/plugins/enrichment/ImportExportLinker.js.map +1 -1
- package/dist/plugins/enrichment/InstanceOfResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/InstanceOfResolver.js +3 -1
- package/dist/plugins/enrichment/InstanceOfResolver.js.map +1 -1
- package/dist/plugins/enrichment/MethodCallResolver.d.ts +17 -68
- package/dist/plugins/enrichment/MethodCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/MethodCallResolver.js +42 -517
- package/dist/plugins/enrichment/MethodCallResolver.js.map +1 -1
- package/dist/plugins/enrichment/MountPointResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/MountPointResolver.js +9 -2
- package/dist/plugins/enrichment/MountPointResolver.js.map +1 -1
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.js +7 -16
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.js.map +1 -1
- package/dist/plugins/enrichment/PrefixEvaluator.d.ts.map +1 -1
- package/dist/plugins/enrichment/PrefixEvaluator.js +6 -2
- package/dist/plugins/enrichment/PrefixEvaluator.js.map +1 -1
- package/dist/plugins/enrichment/RejectionPropagationEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/RejectionPropagationEnricher.js +3 -1
- package/dist/plugins/enrichment/RejectionPropagationEnricher.js.map +1 -1
- package/dist/plugins/enrichment/RustFFIEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/RustFFIEnricher.js +3 -1
- package/dist/plugins/enrichment/RustFFIEnricher.js.map +1 -1
- package/dist/plugins/enrichment/ServiceConnectionEnricher.d.ts +76 -0
- package/dist/plugins/enrichment/ServiceConnectionEnricher.d.ts.map +1 -0
- package/dist/plugins/enrichment/ServiceConnectionEnricher.js +355 -0
- package/dist/plugins/enrichment/ServiceConnectionEnricher.js.map +1 -0
- package/dist/plugins/enrichment/SocketConnectionEnricher.d.ts +42 -0
- package/dist/plugins/enrichment/SocketConnectionEnricher.d.ts.map +1 -0
- package/dist/plugins/enrichment/SocketConnectionEnricher.js +166 -0
- package/dist/plugins/enrichment/SocketConnectionEnricher.js.map +1 -0
- package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts.map +1 -1
- package/dist/plugins/enrichment/ValueDomainAnalyzer.js +3 -1
- package/dist/plugins/enrichment/ValueDomainAnalyzer.js.map +1 -1
- package/dist/plugins/enrichment/method-call/MethodCallData.d.ts +68 -0
- package/dist/plugins/enrichment/method-call/MethodCallData.d.ts.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallData.js +227 -0
- package/dist/plugins/enrichment/method-call/MethodCallData.js.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallDetectors.d.ts +21 -0
- package/dist/plugins/enrichment/method-call/MethodCallDetectors.d.ts.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallDetectors.js +52 -0
- package/dist/plugins/enrichment/method-call/MethodCallDetectors.js.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallErrorAnalysis.d.ts +22 -0
- package/dist/plugins/enrichment/method-call/MethodCallErrorAnalysis.d.ts.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallErrorAnalysis.js +105 -0
- package/dist/plugins/enrichment/method-call/MethodCallErrorAnalysis.js.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallIndexers.d.ts +19 -0
- package/dist/plugins/enrichment/method-call/MethodCallIndexers.d.ts.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallIndexers.js +63 -0
- package/dist/plugins/enrichment/method-call/MethodCallIndexers.js.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallResolution.d.ts +30 -0
- package/dist/plugins/enrichment/method-call/MethodCallResolution.d.ts.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallResolution.js +138 -0
- package/dist/plugins/enrichment/method-call/MethodCallResolution.js.map +1 -0
- package/dist/plugins/indexing/IncrementalModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/IncrementalModuleIndexer.js +2 -8
- package/dist/plugins/indexing/IncrementalModuleIndexer.js.map +1 -1
- package/dist/plugins/indexing/JSModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/JSModuleIndexer.js +13 -20
- package/dist/plugins/indexing/JSModuleIndexer.js.map +1 -1
- package/dist/plugins/indexing/RustModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/RustModuleIndexer.js +4 -8
- package/dist/plugins/indexing/RustModuleIndexer.js.map +1 -1
- package/dist/plugins/validation/AwaitInLoopValidator.d.ts +24 -0
- package/dist/plugins/validation/AwaitInLoopValidator.d.ts.map +1 -0
- package/dist/plugins/validation/AwaitInLoopValidator.js +69 -0
- package/dist/plugins/validation/AwaitInLoopValidator.js.map +1 -0
- package/dist/plugins/validation/PackageCoverageValidator.d.ts +33 -0
- package/dist/plugins/validation/PackageCoverageValidator.d.ts.map +1 -0
- package/dist/plugins/validation/PackageCoverageValidator.js +149 -0
- package/dist/plugins/validation/PackageCoverageValidator.js.map +1 -0
- package/dist/plugins/validation/UnconnectedRouteValidator.d.ts +18 -0
- package/dist/plugins/validation/UnconnectedRouteValidator.d.ts.map +1 -0
- package/dist/plugins/validation/UnconnectedRouteValidator.js +68 -0
- package/dist/plugins/validation/UnconnectedRouteValidator.js.map +1 -0
- package/dist/queries/NodeContext.d.ts +81 -0
- package/dist/queries/NodeContext.d.ts.map +1 -0
- package/dist/queries/NodeContext.js +193 -0
- package/dist/queries/NodeContext.js.map +1 -0
- package/dist/queries/findCallsInFunction.d.ts.map +1 -1
- package/dist/queries/findCallsInFunction.js +10 -2
- package/dist/queries/findCallsInFunction.js.map +1 -1
- package/dist/queries/findContainingFunction.d.ts +3 -2
- package/dist/queries/findContainingFunction.d.ts.map +1 -1
- package/dist/queries/findContainingFunction.js +13 -3
- package/dist/queries/findContainingFunction.js.map +1 -1
- package/dist/queries/index.d.ts +2 -0
- package/dist/queries/index.d.ts.map +1 -1
- package/dist/queries/index.js +1 -0
- package/dist/queries/index.js.map +1 -1
- package/dist/resources/InfraResourceMapImpl.d.ts +31 -0
- package/dist/resources/InfraResourceMapImpl.d.ts.map +1 -0
- package/dist/resources/InfraResourceMapImpl.js +110 -0
- package/dist/resources/InfraResourceMapImpl.js.map +1 -0
- package/dist/resources/RoutingMapImpl.d.ts +33 -0
- package/dist/resources/RoutingMapImpl.d.ts.map +1 -0
- package/dist/resources/RoutingMapImpl.js +115 -0
- package/dist/resources/RoutingMapImpl.js.map +1 -0
- package/dist/storage/backends/RFDBServerBackend.d.ts +35 -6
- package/dist/storage/backends/RFDBServerBackend.d.ts.map +1 -1
- package/dist/storage/backends/RFDBServerBackend.js +102 -70
- package/dist/storage/backends/RFDBServerBackend.js.map +1 -1
- package/dist/utils/findRfdbBinary.d.ts +3 -2
- package/dist/utils/findRfdbBinary.d.ts.map +1 -1
- package/dist/utils/findRfdbBinary.js +22 -7
- package/dist/utils/findRfdbBinary.js.map +1 -1
- package/dist/utils/moduleResolution.d.ts.map +1 -1
- package/dist/utils/moduleResolution.js +26 -1
- package/dist/utils/moduleResolution.js.map +1 -1
- package/dist/utils/resolveNodeFile.d.ts +13 -0
- package/dist/utils/resolveNodeFile.d.ts.map +1 -0
- package/dist/utils/resolveNodeFile.js +18 -0
- package/dist/utils/resolveNodeFile.js.map +1 -0
- package/dist/version.d.ts +11 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +26 -0
- package/dist/version.js.map +1 -0
- package/package.json +3 -3
- package/src/DiscoveryManager.ts +279 -0
- package/src/GraphInitializer.ts +131 -0
- package/src/GuaranteeChecker.ts +90 -0
- package/src/Orchestrator.ts +222 -963
- package/src/OrchestratorTypes.ts +122 -0
- package/src/ParallelAnalysisRunner.ts +188 -0
- package/src/PhaseRunner.ts +450 -0
- package/src/config/ConfigLoader.ts +176 -2
- package/src/config/index.ts +2 -0
- package/src/core/ASTWorker.ts +9 -2
- package/src/core/FileOverview.ts +374 -0
- package/src/core/GraphFreshnessChecker.ts +7 -5
- package/src/core/GuaranteeManager.ts +70 -2
- package/src/core/IncrementalReanalyzer.ts +6 -3
- package/src/core/NodeFactory.ts +173 -652
- package/src/core/ResourceRegistry.ts +39 -0
- package/src/core/ScopeTracker.ts +23 -0
- package/src/core/SemanticId.ts +183 -0
- package/src/core/brandNodeInternal.ts +16 -0
- package/src/core/buildDependencyGraph.ts +98 -0
- package/src/core/factories/CoreFactory.ts +489 -0
- package/src/core/factories/DatabaseFactory.ts +63 -0
- package/src/core/factories/ExternalFactory.ts +23 -0
- package/src/core/factories/HttpFactory.ts +57 -0
- package/src/core/factories/ReactFactory.ts +15 -0
- package/src/core/factories/RustFactory.ts +128 -0
- package/src/core/factories/ServiceFactory.ts +27 -0
- package/src/core/factories/SocketFactory.ts +94 -0
- package/src/core/nodes/DatabaseNode.ts +175 -0
- package/src/core/nodes/ExpressMiddlewareNode.ts +98 -0
- package/src/core/nodes/ExpressMountNode.ts +94 -0
- package/src/core/nodes/ExternalApiNode.ts +53 -0
- package/src/core/nodes/ExternalFunctionNode.ts +77 -0
- package/src/core/nodes/FetchRequestNode.ts +105 -0
- package/src/core/nodes/HttpRouteNode.ts +113 -0
- package/src/core/nodes/NodeKind.ts +1 -0
- package/src/core/nodes/ReactNode.ts +78 -0
- package/src/core/nodes/RustCallNode.ts +96 -0
- package/src/core/nodes/RustFunctionNode.ts +112 -0
- package/src/core/nodes/RustImplNode.ts +78 -0
- package/src/core/nodes/RustMethodNode.ts +125 -0
- package/src/core/nodes/RustModuleNode.ts +84 -0
- package/src/core/nodes/RustStructNode.ts +80 -0
- package/src/core/nodes/RustTraitNode.ts +82 -0
- package/src/core/nodes/ServiceLayerNode.ts +183 -0
- package/src/core/nodes/SocketIONode.ts +177 -0
- package/src/core/nodes/SocketNode.ts +206 -0
- package/src/core/nodes/TypeNode.ts +46 -3
- package/src/core/nodes/TypeParameterNode.ts +91 -0
- package/src/core/nodes/index.ts +57 -0
- package/src/index.ts +60 -4
- package/src/plugins/InfraAnalyzer.ts +208 -0
- package/src/plugins/analysis/DatabaseAnalyzer.ts +27 -17
- package/src/plugins/analysis/ExpressAnalyzer.ts +51 -38
- package/src/plugins/analysis/ExpressResponseAnalyzer.ts +15 -12
- package/src/plugins/analysis/ExpressRouteAnalyzer.ts +56 -56
- package/src/plugins/analysis/FetchAnalyzer.ts +42 -52
- package/src/plugins/analysis/IncrementalAnalysisPlugin.ts +3 -2
- package/src/plugins/analysis/JSASTAnalyzer.ts +391 -2304
- package/src/plugins/analysis/NestJSRouteAnalyzer.ts +241 -0
- package/src/plugins/analysis/ReactAnalyzer.ts +33 -1085
- package/src/plugins/analysis/RustAnalyzer.ts +112 -116
- package/src/plugins/analysis/SQLiteAnalyzer.ts +23 -9
- package/src/plugins/analysis/ServiceLayerAnalyzer.ts +32 -10
- package/src/plugins/analysis/SocketAnalyzer.ts +601 -0
- package/src/plugins/analysis/SocketIOAnalyzer.ts +25 -34
- package/src/plugins/analysis/SystemDbAnalyzer.ts +15 -12
- package/src/plugins/analysis/ast/CollisionResolver.ts +137 -0
- package/src/plugins/analysis/ast/FunctionBodyContext.ts +291 -0
- package/src/plugins/analysis/ast/GraphBuilder.ts +274 -3180
- package/src/plugins/analysis/ast/IdGenerator.ts +81 -1
- package/src/plugins/analysis/ast/builders/AssignmentBuilder.ts +407 -0
- package/src/plugins/analysis/ast/builders/CallFlowBuilder.ts +255 -0
- package/src/plugins/analysis/ast/builders/ControlFlowBuilder.ts +470 -0
- package/src/plugins/analysis/ast/builders/CoreBuilder.ts +306 -0
- package/src/plugins/analysis/ast/builders/ModuleRuntimeBuilder.ts +452 -0
- package/src/plugins/analysis/ast/builders/MutationBuilder.ts +372 -0
- package/src/plugins/analysis/ast/builders/ReturnBuilder.ts +279 -0
- package/src/plugins/analysis/ast/builders/TypeSystemBuilder.ts +475 -0
- package/src/plugins/analysis/ast/builders/UpdateExpressionBuilder.ts +262 -0
- package/src/plugins/analysis/ast/builders/YieldBuilder.ts +287 -0
- package/src/plugins/analysis/ast/builders/index.ts +11 -0
- package/src/plugins/analysis/ast/builders/types.ts +65 -0
- package/src/plugins/analysis/ast/handlers/AnalyzerDelegate.ts +183 -0
- package/src/plugins/analysis/ast/handlers/BranchHandler.ts +313 -0
- package/src/plugins/analysis/ast/handlers/CallExpressionHandler.ts +347 -0
- package/src/plugins/analysis/ast/handlers/FunctionBodyHandler.ts +24 -0
- package/src/plugins/analysis/ast/handlers/LoopHandler.ts +240 -0
- package/src/plugins/analysis/ast/handlers/NestedFunctionHandler.ts +201 -0
- package/src/plugins/analysis/ast/handlers/NewExpressionHandler.ts +159 -0
- package/src/plugins/analysis/ast/handlers/PropertyAccessHandler.ts +112 -0
- package/src/plugins/analysis/ast/handlers/ReturnYieldHandler.ts +166 -0
- package/src/plugins/analysis/ast/handlers/ThrowHandler.ts +101 -0
- package/src/plugins/analysis/ast/handlers/TryCatchHandler.ts +262 -0
- package/src/plugins/analysis/ast/handlers/VariableHandler.ts +93 -0
- package/src/plugins/analysis/ast/handlers/index.ts +12 -0
- package/src/plugins/analysis/ast/types.ts +68 -9
- package/src/plugins/analysis/ast/utils/createParameterNodes.ts +118 -13
- package/src/plugins/analysis/ast/utils/extractNamesFromPattern.ts +166 -0
- package/src/plugins/analysis/ast/utils/getExpressionValue.ts +34 -0
- package/src/plugins/analysis/ast/utils/getMemberExpressionName.ts +33 -0
- package/src/plugins/analysis/ast/utils/index.ts +2 -0
- package/src/plugins/analysis/ast/visitors/ArgumentExtractor.ts +307 -0
- package/src/plugins/analysis/ast/visitors/ArrayElementExtractor.ts +172 -0
- package/src/plugins/analysis/ast/visitors/CallExpressionVisitor.ts +425 -1374
- package/src/plugins/analysis/ast/visitors/ClassVisitor.ts +43 -12
- package/src/plugins/analysis/ast/visitors/FunctionVisitor.ts +39 -8
- package/src/plugins/analysis/ast/visitors/MutationDetector.ts +211 -0
- package/src/plugins/analysis/ast/visitors/ObjectPropertyExtractor.ts +217 -0
- package/src/plugins/analysis/ast/visitors/PropertyAccessVisitor.ts +69 -4
- package/src/plugins/analysis/ast/visitors/TypeScriptVisitor.ts +232 -13
- package/src/plugins/analysis/ast/visitors/VariableVisitor.ts +8 -11
- package/src/plugins/analysis/ast/visitors/call-expression-helpers.ts +65 -0
- package/src/plugins/analysis/ast/visitors/call-expression-types.ts +179 -0
- package/src/plugins/analysis/react-internal/browser-api.ts +168 -0
- package/src/plugins/analysis/react-internal/hooks.ts +517 -0
- package/src/plugins/analysis/react-internal/jsx.ts +279 -0
- package/src/plugins/analysis/react-internal/types.ts +183 -0
- package/src/plugins/discovery/MonorepoServiceDiscovery.ts +6 -14
- package/src/plugins/enrichment/AliasTracker.ts +3 -1
- package/src/plugins/enrichment/ArgumentParameterLinker.ts +3 -1
- package/src/plugins/enrichment/CallbackCallResolver.ts +398 -0
- package/src/plugins/enrichment/ClosureCaptureEnricher.ts +3 -1
- package/src/plugins/enrichment/ConfigRoutingMapBuilder.ts +67 -0
- package/src/plugins/enrichment/ExpressHandlerLinker.ts +3 -1
- package/src/plugins/enrichment/ExternalCallResolver.ts +5 -8
- package/src/plugins/enrichment/FunctionCallResolver.ts +6 -9
- package/src/plugins/enrichment/HTTPConnectionEnricher.ts +3 -1
- package/src/plugins/enrichment/ImportExportLinker.ts +5 -3
- package/src/plugins/enrichment/InstanceOfResolver.ts +3 -1
- package/src/plugins/enrichment/MethodCallResolver.ts +48 -659
- package/src/plugins/enrichment/MountPointResolver.ts +9 -2
- package/src/plugins/enrichment/NodejsBuiltinsResolver.ts +13 -18
- package/src/plugins/enrichment/PrefixEvaluator.ts +6 -2
- package/src/plugins/enrichment/RejectionPropagationEnricher.ts +3 -1
- package/src/plugins/enrichment/RustFFIEnricher.ts +3 -1
- package/src/plugins/enrichment/ServiceConnectionEnricher.ts +472 -0
- package/src/plugins/enrichment/SocketConnectionEnricher.ts +228 -0
- package/src/plugins/enrichment/ValueDomainAnalyzer.ts +3 -1
- package/src/plugins/enrichment/method-call/MethodCallData.ts +299 -0
- package/src/plugins/enrichment/method-call/MethodCallDetectors.ts +70 -0
- package/src/plugins/enrichment/method-call/MethodCallErrorAnalysis.ts +131 -0
- package/src/plugins/enrichment/method-call/MethodCallIndexers.ts +83 -0
- package/src/plugins/enrichment/method-call/MethodCallResolution.ts +181 -0
- package/src/plugins/indexing/IncrementalModuleIndexer.ts +5 -10
- package/src/plugins/indexing/JSModuleIndexer.ts +17 -21
- package/src/plugins/indexing/RustModuleIndexer.ts +14 -13
- package/src/plugins/validation/AwaitInLoopValidator.ts +91 -0
- package/src/plugins/validation/PackageCoverageValidator.ts +181 -0
- package/src/plugins/validation/UnconnectedRouteValidator.ts +93 -0
- package/src/queries/NodeContext.ts +277 -0
- package/src/queries/findCallsInFunction.ts +11 -2
- package/src/queries/findContainingFunction.ts +14 -3
- package/src/queries/index.ts +13 -0
- package/src/resources/InfraResourceMapImpl.ts +119 -0
- package/src/resources/RoutingMapImpl.ts +133 -0
- package/src/storage/backends/RFDBServerBackend.ts +106 -77
- package/src/utils/findRfdbBinary.ts +22 -7
- package/src/utils/moduleResolution.ts +28 -1
- package/src/utils/resolveNodeFile.ts +18 -0
- package/src/version.ts +28 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { getLine } from '../utils/location.js';
|
|
2
|
+
import { PropertyAccessVisitor } from '../visitors/index.js';
|
|
3
|
+
import { FunctionBodyHandler } from './FunctionBodyHandler.js';
|
|
4
|
+
export class PropertyAccessHandler extends FunctionBodyHandler {
|
|
5
|
+
getHandlers() {
|
|
6
|
+
const ctx = this.ctx;
|
|
7
|
+
const analyzer = this.analyzer;
|
|
8
|
+
return {
|
|
9
|
+
UpdateExpression: (updatePath) => {
|
|
10
|
+
const updateNode = updatePath.node;
|
|
11
|
+
// REG-288/REG-312: Collect update expression info for graph building
|
|
12
|
+
analyzer.collectUpdateExpression(updateNode, ctx.module, ctx.updateExpressions, ctx.getCurrentScopeId(), ctx.scopeTracker);
|
|
13
|
+
// Legacy behavior: update scope.modifies for IDENTIFIER targets
|
|
14
|
+
if (updateNode.argument.type === 'Identifier') {
|
|
15
|
+
const varName = updateNode.argument.name;
|
|
16
|
+
// Find variable by name - could be from parent scope or declarations
|
|
17
|
+
const fromParentScope = Array.from(ctx.parentScopeVariables).find(v => v.name === varName);
|
|
18
|
+
const fromDeclarations = ctx.variableDeclarations.find(v => v.name === varName);
|
|
19
|
+
const variable = fromParentScope ?? fromDeclarations;
|
|
20
|
+
if (variable) {
|
|
21
|
+
const scope = ctx.scopes.find(s => s.id === ctx.parentScopeId);
|
|
22
|
+
if (scope) {
|
|
23
|
+
if (!scope.modifies)
|
|
24
|
+
scope.modifies = [];
|
|
25
|
+
scope.modifies.push({
|
|
26
|
+
variableId: variable.id,
|
|
27
|
+
variableName: varName,
|
|
28
|
+
line: getLine(updateNode)
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
// Property access expressions (REG-395)
|
|
35
|
+
// Shared handler for both MemberExpression and OptionalMemberExpression
|
|
36
|
+
MemberExpression: (memberPath) => {
|
|
37
|
+
// Initialize collections if needed
|
|
38
|
+
if (!ctx.collections.propertyAccesses) {
|
|
39
|
+
ctx.collections.propertyAccesses = [];
|
|
40
|
+
}
|
|
41
|
+
if (!ctx.collections.propertyAccessCounterRef) {
|
|
42
|
+
ctx.collections.propertyAccessCounterRef = { value: 0 };
|
|
43
|
+
}
|
|
44
|
+
PropertyAccessVisitor.extractPropertyAccesses(memberPath, memberPath.node, ctx.module, ctx.collections.propertyAccesses, ctx.collections.propertyAccessCounterRef, ctx.scopeTracker, ctx.currentFunctionId || ctx.getCurrentScopeId());
|
|
45
|
+
},
|
|
46
|
+
// OptionalMemberExpression: obj?.prop (same logic as MemberExpression)
|
|
47
|
+
OptionalMemberExpression: (memberPath) => {
|
|
48
|
+
// Initialize collections if needed
|
|
49
|
+
if (!ctx.collections.propertyAccesses) {
|
|
50
|
+
ctx.collections.propertyAccesses = [];
|
|
51
|
+
}
|
|
52
|
+
if (!ctx.collections.propertyAccessCounterRef) {
|
|
53
|
+
ctx.collections.propertyAccessCounterRef = { value: 0 };
|
|
54
|
+
}
|
|
55
|
+
PropertyAccessVisitor.extractPropertyAccesses(memberPath, memberPath.node, ctx.module, ctx.collections.propertyAccesses, ctx.collections.propertyAccessCounterRef, ctx.scopeTracker, ctx.currentFunctionId || ctx.getCurrentScopeId());
|
|
56
|
+
},
|
|
57
|
+
// MetaProperty: new.target (REG-301)
|
|
58
|
+
MetaProperty: (metaPath) => {
|
|
59
|
+
// Initialize collections if needed
|
|
60
|
+
if (!ctx.collections.propertyAccesses) {
|
|
61
|
+
ctx.collections.propertyAccesses = [];
|
|
62
|
+
}
|
|
63
|
+
if (!ctx.collections.propertyAccessCounterRef) {
|
|
64
|
+
ctx.collections.propertyAccessCounterRef = { value: 0 };
|
|
65
|
+
}
|
|
66
|
+
PropertyAccessVisitor.extractMetaProperty(metaPath.node, ctx.module, ctx.collections.propertyAccesses, ctx.collections.propertyAccessCounterRef, ctx.scopeTracker, ctx.currentFunctionId || ctx.getCurrentScopeId());
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=PropertyAccessHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyAccessHandler.js","sourceRoot":"","sources":["../../../../../src/plugins/analysis/ast/handlers/PropertyAccessHandler.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,OAAO,qBAAsB,SAAQ,mBAAmB;IAC5D,WAAW;QACT,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACrB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAE/B,OAAO;YACL,gBAAgB,EAAE,CAAC,UAAwC,EAAE,EAAE;gBAC7D,MAAM,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC;gBAEnC,qEAAqE;gBACrE,QAAQ,CAAC,uBAAuB,CAAC,UAAU,EAAE,GA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AAkC,EAAE,EAAE;gBACnD,mCAAmC;gBACnC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC;oBACtC,GAAG,CAAC,WAAW,CAAC,gBAAgB,GAAG,EAAE,CAAC;gBACxC,CAAC;gBACD,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,wBAAwB,EAAE,CAAC;oBAC9C,GAAG,CAAC,WAAW,CAAC,wBAAwB,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBAC1D,CAAC;gBAED,qBAAqB,CAAC,mBAAmB,CACvC,QAAQ,CAAC,IAAI,EACb,GAAG,CAAC,MAAM,EACV,GAAG,CAAC,WAAW,CAAC,gBAAwC,EACxD,GAAG,CAAC,WAAW,CAAC,wBAAsC,EACtD,GAAG,CAAC,YAAY,EAChB,GAAG,CAAC,iBAAiB,IAAI,GAAG,CAAC,iBAAiB,EAAE,CACjD,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ReturnYieldHandler — handles ReturnStatement and YieldExpression nodes.
|
|
3
|
+
*
|
|
4
|
+
* Mechanical extraction from analyzeFunctionBody() (REG-422).
|
|
5
|
+
* Original source: JSASTAnalyzer.ts lines ~3835-4061.
|
|
6
|
+
*/
|
|
7
|
+
import type { Visitor } from '@babel/traverse';
|
|
8
|
+
import { FunctionBodyHandler } from './FunctionBodyHandler.js';
|
|
9
|
+
export declare class ReturnYieldHandler extends FunctionBodyHandler {
|
|
10
|
+
getHandlers(): Visitor;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ReturnYieldHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReturnYieldHandler.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/analysis/ast/handlers/ReturnYieldHandler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAY,MAAM,iBAAiB,CAAC;AAIzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,qBAAa,kBAAmB,SAAQ,mBAAmB;IACzD,WAAW,IAAI,OAAO;CAwJvB"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import * as t from '@babel/types';
|
|
2
|
+
import { getLine, getColumn } from '../utils/location.js';
|
|
3
|
+
import { FunctionBodyHandler } from './FunctionBodyHandler.js';
|
|
4
|
+
export class ReturnYieldHandler extends FunctionBodyHandler {
|
|
5
|
+
getHandlers() {
|
|
6
|
+
const ctx = this.ctx;
|
|
7
|
+
const analyzer = this.analyzer;
|
|
8
|
+
return {
|
|
9
|
+
// Handle return statements for RETURNS edges
|
|
10
|
+
ReturnStatement: (returnPath) => {
|
|
11
|
+
// Skip if we couldn't determine the function ID
|
|
12
|
+
if (!ctx.currentFunctionId) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
// Skip if this return is inside a nested function (not the function we're analyzing)
|
|
16
|
+
// Check if there's a function ancestor BETWEEN us and funcNode
|
|
17
|
+
// Stop checking once we reach funcNode - parents above funcNode are outside scope
|
|
18
|
+
let parent = returnPath.parentPath;
|
|
19
|
+
let isInsideConditional = false;
|
|
20
|
+
while (parent) {
|
|
21
|
+
// If we've reached funcNode, we're done checking - this return belongs to funcNode
|
|
22
|
+
if (parent.node === ctx.funcNode) {
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
if (t.isFunction(parent.node)) {
|
|
26
|
+
// Found a function between returnPath and funcNode - this return is inside a nested function
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
// Track if return is inside a conditional block (if/else, switch case, loop, try/catch)
|
|
30
|
+
if (t.isIfStatement(parent.node) ||
|
|
31
|
+
t.isSwitchCase(parent.node) ||
|
|
32
|
+
t.isLoop(parent.node) ||
|
|
33
|
+
t.isTryStatement(parent.node) ||
|
|
34
|
+
t.isCatchClause(parent.node)) {
|
|
35
|
+
isInsideConditional = true;
|
|
36
|
+
}
|
|
37
|
+
parent = parent.parentPath;
|
|
38
|
+
}
|
|
39
|
+
// Phase 6 (REG-267): Track return count and early return detection
|
|
40
|
+
ctx.controlFlowState.returnCount++;
|
|
41
|
+
// A return is "early" if it's inside a conditional structure
|
|
42
|
+
// (More returns after this one indicate the function doesn't always end here)
|
|
43
|
+
if (isInsideConditional) {
|
|
44
|
+
ctx.controlFlowState.hasEarlyReturn = true;
|
|
45
|
+
}
|
|
46
|
+
const returnNode = returnPath.node;
|
|
47
|
+
const returnLine = getLine(returnNode);
|
|
48
|
+
const returnColumn = getColumn(returnNode);
|
|
49
|
+
// Handle bare return; (no value)
|
|
50
|
+
if (!returnNode.argument) {
|
|
51
|
+
// Skip - no data flow value
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const arg = returnNode.argument;
|
|
55
|
+
// Extract expression-specific info using shared method
|
|
56
|
+
const exprInfo = analyzer.extractReturnExpressionInfo(arg, ctx.module, ctx.literals, ctx.literalCounterRef, returnLine, returnColumn, 'return');
|
|
57
|
+
const returnInfo = {
|
|
58
|
+
parentFunctionId: ctx.currentFunctionId,
|
|
59
|
+
file: ctx.module.file,
|
|
60
|
+
line: returnLine,
|
|
61
|
+
column: returnColumn,
|
|
62
|
+
returnValueType: 'NONE',
|
|
63
|
+
...exprInfo,
|
|
64
|
+
};
|
|
65
|
+
ctx.returnStatements.push(returnInfo);
|
|
66
|
+
},
|
|
67
|
+
// Handle yield expressions for YIELDS/DELEGATES_TO edges (REG-270)
|
|
68
|
+
YieldExpression: (yieldPath) => {
|
|
69
|
+
// Skip if we couldn't determine the function ID
|
|
70
|
+
if (!ctx.currentFunctionId) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
// Skip if this yield is inside a nested function (not the function we're analyzing)
|
|
74
|
+
// Check if there's a function ancestor BETWEEN us and funcNode
|
|
75
|
+
let parent = yieldPath.parentPath;
|
|
76
|
+
while (parent) {
|
|
77
|
+
// If we've reached funcNode, we're done checking - this yield belongs to funcNode
|
|
78
|
+
if (parent.node === ctx.funcNode) {
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
if (t.isFunction(parent.node)) {
|
|
82
|
+
// Found a function between yieldPath and funcNode - this yield is inside a nested function
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
parent = parent.parentPath;
|
|
86
|
+
}
|
|
87
|
+
const yieldNode = yieldPath.node;
|
|
88
|
+
const yieldLine = getLine(yieldNode);
|
|
89
|
+
const yieldColumn = getColumn(yieldNode);
|
|
90
|
+
const isDelegate = yieldNode.delegate ?? false;
|
|
91
|
+
// Handle bare yield; (no value) - only valid for non-delegate yield
|
|
92
|
+
if (!yieldNode.argument && !isDelegate) {
|
|
93
|
+
// Skip - no data flow value
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
// For yield* without argument (syntax error in practice, but handle gracefully)
|
|
97
|
+
if (!yieldNode.argument) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const arg = yieldNode.argument;
|
|
101
|
+
// Extract expression-specific info using shared method
|
|
102
|
+
// Note: We reuse extractReturnExpressionInfo since yield values have identical semantics
|
|
103
|
+
const exprInfo = analyzer.extractReturnExpressionInfo(arg, ctx.module, ctx.literals, ctx.literalCounterRef, yieldLine, yieldColumn, 'yield');
|
|
104
|
+
// Map ReturnStatementInfo fields to YieldExpressionInfo fields
|
|
105
|
+
const yieldInfo = {
|
|
106
|
+
parentFunctionId: ctx.currentFunctionId,
|
|
107
|
+
file: ctx.module.file,
|
|
108
|
+
line: yieldLine,
|
|
109
|
+
column: yieldColumn,
|
|
110
|
+
isDelegate,
|
|
111
|
+
yieldValueType: exprInfo.returnValueType ?? 'NONE',
|
|
112
|
+
yieldValueName: exprInfo.returnValueName,
|
|
113
|
+
yieldValueId: exprInfo.returnValueId,
|
|
114
|
+
yieldValueLine: exprInfo.returnValueLine,
|
|
115
|
+
yieldValueColumn: exprInfo.returnValueColumn,
|
|
116
|
+
yieldValueCallName: exprInfo.returnValueCallName,
|
|
117
|
+
expressionType: exprInfo.expressionType,
|
|
118
|
+
operator: exprInfo.operator,
|
|
119
|
+
leftSourceName: exprInfo.leftSourceName,
|
|
120
|
+
rightSourceName: exprInfo.rightSourceName,
|
|
121
|
+
consequentSourceName: exprInfo.consequentSourceName,
|
|
122
|
+
alternateSourceName: exprInfo.alternateSourceName,
|
|
123
|
+
object: exprInfo.object,
|
|
124
|
+
property: exprInfo.property,
|
|
125
|
+
computed: exprInfo.computed,
|
|
126
|
+
objectSourceName: exprInfo.objectSourceName,
|
|
127
|
+
expressionSourceNames: exprInfo.expressionSourceNames,
|
|
128
|
+
unaryArgSourceName: exprInfo.unaryArgSourceName,
|
|
129
|
+
};
|
|
130
|
+
ctx.yieldExpressions.push(yieldInfo);
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=ReturnYieldHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReturnYieldHandler.js","sourceRoot":"","sources":["../../../../../src/plugins/analysis/ast/handlers/ReturnYieldHandler.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,OAAO,kBAAmB,SAAQ,mBAAmB;IACzD,WAAW;QACT,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACrB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAE/B,OAAO;YACL,6CAA6C;YAC7C,eAAe,EAAE,CAAC,UAAuC,EAAE,EAAE;gBAC3D,gDAAgD;gBAChD,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;oBAC3B,OAAO;gBACT,CAAC;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;oBACzC,oBAAoB,EAAE,QAAQ,CAAC,oBAAoB;oBACnD,mBAAmB,EAAE,QAAQ,CAAC,mBAAmB;oBACjD,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;oBAC3B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;oBAC3B,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;oBAC3C,qBAAqB,EAAE,QAAQ,CAAC,qBAAqB;oBACrD,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB;iBAChD,CAAC;gBAEF,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACvC,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ThrowHandler — handles ThrowStatement nodes.
|
|
3
|
+
*
|
|
4
|
+
* Mechanical extraction from analyzeFunctionBody() (REG-422).
|
|
5
|
+
* Original source: JSASTAnalyzer.ts lines ~3908-3985.
|
|
6
|
+
*/
|
|
7
|
+
import type { Visitor } from '@babel/traverse';
|
|
8
|
+
import { FunctionBodyHandler } from './FunctionBodyHandler.js';
|
|
9
|
+
export declare class ThrowHandler extends FunctionBodyHandler {
|
|
10
|
+
getHandlers(): Visitor;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ThrowHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThrowHandler.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/analysis/ast/handlers/ThrowHandler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAY,MAAM,iBAAiB,CAAC;AAGzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,qBAAa,YAAa,SAAQ,mBAAmB;IACnD,WAAW,IAAI,OAAO;CAwFvB"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as t from '@babel/types';
|
|
2
|
+
import { getLine, getColumn } from '../utils/location.js';
|
|
3
|
+
import { FunctionBodyHandler } from './FunctionBodyHandler.js';
|
|
4
|
+
export class ThrowHandler extends FunctionBodyHandler {
|
|
5
|
+
getHandlers() {
|
|
6
|
+
const ctx = this.ctx;
|
|
7
|
+
const analyzer = this.analyzer;
|
|
8
|
+
return {
|
|
9
|
+
// Phase 6 (REG-267): Track throw statements for control flow metadata
|
|
10
|
+
// REG-311: Detect async_throw rejection patterns
|
|
11
|
+
// REG-286: Detect sync_throw patterns for ALL functions (THROWS edges)
|
|
12
|
+
ThrowStatement: (throwPath) => {
|
|
13
|
+
// Skip if this throw is inside a nested function (not the function we're analyzing)
|
|
14
|
+
let parent = throwPath.parentPath;
|
|
15
|
+
while (parent) {
|
|
16
|
+
if (t.isFunction(parent.node) && parent.node !== ctx.funcNode) {
|
|
17
|
+
// This throw is inside a nested function - skip it
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
parent = parent.parentPath;
|
|
21
|
+
}
|
|
22
|
+
ctx.controlFlowState.hasThrow = true;
|
|
23
|
+
// REG-286: Track throw patterns for ALL functions (sync and async)
|
|
24
|
+
// Async throws -> REJECTS edges, sync throws -> THROWS edges
|
|
25
|
+
const isAsyncFunction = ctx.functionNode?.async === true;
|
|
26
|
+
if (ctx.currentFunctionId && ctx.functionNode && ctx.functionPath) {
|
|
27
|
+
const throwNode = throwPath.node;
|
|
28
|
+
const arg = throwNode.argument;
|
|
29
|
+
const throwLine = getLine(throwNode);
|
|
30
|
+
const throwColumn = getColumn(throwNode);
|
|
31
|
+
// Case 1: throw new Error() or throw new CustomError()
|
|
32
|
+
if (arg && t.isNewExpression(arg) && t.isIdentifier(arg.callee)) {
|
|
33
|
+
ctx.rejectionPatterns.push({
|
|
34
|
+
functionId: ctx.currentFunctionId,
|
|
35
|
+
errorClassName: arg.callee.name,
|
|
36
|
+
rejectionType: isAsyncFunction ? 'async_throw' : 'sync_throw',
|
|
37
|
+
isAsync: isAsyncFunction,
|
|
38
|
+
file: ctx.module.file,
|
|
39
|
+
line: throwLine,
|
|
40
|
+
column: throwColumn
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
// Case 2: throw identifier - needs micro-trace
|
|
44
|
+
else if (arg && t.isIdentifier(arg)) {
|
|
45
|
+
const varName = arg.name;
|
|
46
|
+
// Check if it's a parameter
|
|
47
|
+
const isParameter = ctx.functionNode.params.some(param => t.isIdentifier(param) && param.name === varName);
|
|
48
|
+
if (isParameter) {
|
|
49
|
+
// Parameter forwarding - can't resolve statically
|
|
50
|
+
ctx.rejectionPatterns.push({
|
|
51
|
+
functionId: ctx.currentFunctionId,
|
|
52
|
+
errorClassName: null,
|
|
53
|
+
rejectionType: 'variable_parameter',
|
|
54
|
+
isAsync: isAsyncFunction,
|
|
55
|
+
file: ctx.module.file,
|
|
56
|
+
line: throwLine,
|
|
57
|
+
column: throwColumn,
|
|
58
|
+
sourceVariableName: varName
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
// Try micro-trace
|
|
63
|
+
const { errorClassName, tracePath } = analyzer.microTraceToErrorClass(varName, ctx.functionPath, ctx.variableDeclarations);
|
|
64
|
+
ctx.rejectionPatterns.push({
|
|
65
|
+
functionId: ctx.currentFunctionId,
|
|
66
|
+
errorClassName,
|
|
67
|
+
rejectionType: errorClassName ? 'variable_traced' : 'variable_unknown',
|
|
68
|
+
isAsync: isAsyncFunction,
|
|
69
|
+
file: ctx.module.file,
|
|
70
|
+
line: throwLine,
|
|
71
|
+
column: throwColumn,
|
|
72
|
+
sourceVariableName: varName,
|
|
73
|
+
tracePath
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=ThrowHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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AAE,OAAO;6BAC5B,CAAC,CAAC;wBACL,CAAC;6BAAM,CAAC;4BACN,kBAAkB;4BAClB,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAC,sBAAsB,CACnE,OAAO,EACP,GAAG,CAAC,YAAY,EAChB,GAAG,CAAC,oBAAoB,CACzB,CAAC;4BAEF,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC;gCACzB,UAAU,EAAE,GAAG,CAAC,iBAAiB;gCACjC,cAAc;gCACd,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,kBAAkB;gCACtE,OAAO,EAAE,eAAe;gCACxB,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI;gCACrB,IAAI,EAAE,SAAS;gCACf,MAAM,EAAE,WAAW;gCACnB,kBAAkB,EAAE,OAAO;gCAC3B,SAAS;6BACV,CAAC,CAAC;wBACL,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TryCatchHandler -- handles try/catch/finally control flow nodes.
|
|
3
|
+
*
|
|
4
|
+
* Inlines the createTryStatementHandler and createCatchClauseHandler logic
|
|
5
|
+
* from JSASTAnalyzer (REG-422).
|
|
6
|
+
*/
|
|
7
|
+
import type { Visitor } from '@babel/traverse';
|
|
8
|
+
import { FunctionBodyHandler } from './FunctionBodyHandler.js';
|
|
9
|
+
export declare class TryCatchHandler extends FunctionBodyHandler {
|
|
10
|
+
getHandlers(): Visitor;
|
|
11
|
+
private createTryStatementVisitor;
|
|
12
|
+
private createCatchClauseVisitor;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=TryCatchHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TryCatchHandler.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/analysis/ast/handlers/TryCatchHandler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAY,MAAM,iBAAiB,CAAC;AAIzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,qBAAa,eAAgB,SAAQ,mBAAmB;IACtD,WAAW,IAAI,OAAO;IAOtB,OAAO,CAAC,yBAAyB;IAmLjC,OAAO,CAAC,wBAAwB;CA8DjC"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import * as t from '@babel/types';
|
|
2
|
+
import { getLine, getColumn } from '../utils/location.js';
|
|
3
|
+
import { computeSemanticId } from '../../../../core/SemanticId.js';
|
|
4
|
+
import { FunctionBodyHandler } from './FunctionBodyHandler.js';
|
|
5
|
+
export class TryCatchHandler extends FunctionBodyHandler {
|
|
6
|
+
getHandlers() {
|
|
7
|
+
return {
|
|
8
|
+
TryStatement: this.createTryStatementVisitor(),
|
|
9
|
+
CatchClause: this.createCatchClauseVisitor(),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
createTryStatementVisitor() {
|
|
13
|
+
const ctx = this.ctx;
|
|
14
|
+
const analyzer = this.analyzer;
|
|
15
|
+
return {
|
|
16
|
+
enter: (tryPath) => {
|
|
17
|
+
const tryNode = tryPath.node;
|
|
18
|
+
// Phase 6 (REG-267): Mark that this function has try/catch
|
|
19
|
+
if (ctx.controlFlowState) {
|
|
20
|
+
ctx.controlFlowState.hasTryCatch = true;
|
|
21
|
+
// REG-311: Increment try block depth for O(1) isInsideTry detection
|
|
22
|
+
ctx.controlFlowState.tryBlockDepth++;
|
|
23
|
+
}
|
|
24
|
+
// Determine actual parent - use stack for nested structures, otherwise original parentScopeId
|
|
25
|
+
const actualParentScopeId = (ctx.scopeIdStack && ctx.scopeIdStack.length > 0)
|
|
26
|
+
? ctx.scopeIdStack[ctx.scopeIdStack.length - 1]
|
|
27
|
+
: ctx.parentScopeId;
|
|
28
|
+
// 1. Create TRY_BLOCK node
|
|
29
|
+
const tryBlockCounter = ctx.tryBlockCounterRef.value++;
|
|
30
|
+
const legacyTryBlockId = `${ctx.module.file}:TRY_BLOCK:${getLine(tryNode)}:${tryBlockCounter}`;
|
|
31
|
+
const tryBlockId = ctx.scopeTracker
|
|
32
|
+
? computeSemanticId('TRY_BLOCK', 'try', ctx.scopeTracker.getContext(), { discriminator: tryBlockCounter })
|
|
33
|
+
: legacyTryBlockId;
|
|
34
|
+
ctx.tryBlocks.push({
|
|
35
|
+
id: tryBlockId,
|
|
36
|
+
semanticId: tryBlockId,
|
|
37
|
+
type: 'TRY_BLOCK',
|
|
38
|
+
file: ctx.module.file,
|
|
39
|
+
line: getLine(tryNode),
|
|
40
|
+
column: getColumn(tryNode),
|
|
41
|
+
parentScopeId: actualParentScopeId
|
|
42
|
+
});
|
|
43
|
+
// 2. Create try-body SCOPE (backward compatibility)
|
|
44
|
+
// Parent is now TRY_BLOCK, not original parentScopeId
|
|
45
|
+
const tryScopeId = `SCOPE#try-block#${ctx.module.file}#${getLine(tryNode)}:${ctx.scopeCounterRef.value++}`;
|
|
46
|
+
const trySemanticId = analyzer.generateSemanticId('try-block', ctx.scopeTracker);
|
|
47
|
+
ctx.scopes.push({
|
|
48
|
+
id: tryScopeId,
|
|
49
|
+
type: 'SCOPE',
|
|
50
|
+
scopeType: 'try-block',
|
|
51
|
+
semanticId: trySemanticId,
|
|
52
|
+
file: ctx.module.file,
|
|
53
|
+
line: getLine(tryNode),
|
|
54
|
+
parentScopeId: tryBlockId // Parent is TRY_BLOCK
|
|
55
|
+
});
|
|
56
|
+
// 3. Create CATCH_BLOCK and catch-body SCOPE if handler exists
|
|
57
|
+
let catchBlockId = null;
|
|
58
|
+
let catchScopeId = null;
|
|
59
|
+
if (tryNode.handler) {
|
|
60
|
+
const catchClause = tryNode.handler;
|
|
61
|
+
const catchBlockCounter = ctx.catchBlockCounterRef.value++;
|
|
62
|
+
const legacyCatchBlockId = `${ctx.module.file}:CATCH_BLOCK:${getLine(catchClause)}:${catchBlockCounter}`;
|
|
63
|
+
catchBlockId = ctx.scopeTracker
|
|
64
|
+
? computeSemanticId('CATCH_BLOCK', 'catch', ctx.scopeTracker.getContext(), { discriminator: catchBlockCounter })
|
|
65
|
+
: legacyCatchBlockId;
|
|
66
|
+
// Extract parameter name if present
|
|
67
|
+
let parameterName;
|
|
68
|
+
if (catchClause.param && t.isIdentifier(catchClause.param)) {
|
|
69
|
+
parameterName = catchClause.param.name;
|
|
70
|
+
}
|
|
71
|
+
ctx.catchBlocks.push({
|
|
72
|
+
id: catchBlockId,
|
|
73
|
+
semanticId: catchBlockId,
|
|
74
|
+
type: 'CATCH_BLOCK',
|
|
75
|
+
file: ctx.module.file,
|
|
76
|
+
line: getLine(catchClause),
|
|
77
|
+
column: getColumn(catchClause),
|
|
78
|
+
parentScopeId: ctx.parentScopeId,
|
|
79
|
+
parentTryBlockId: tryBlockId,
|
|
80
|
+
parameterName
|
|
81
|
+
});
|
|
82
|
+
// Create catch-body SCOPE (backward compatibility)
|
|
83
|
+
catchScopeId = `SCOPE#catch-block#${ctx.module.file}#${getLine(catchClause)}:${ctx.scopeCounterRef.value++}`;
|
|
84
|
+
const catchSemanticId = analyzer.generateSemanticId('catch-block', ctx.scopeTracker);
|
|
85
|
+
ctx.scopes.push({
|
|
86
|
+
id: catchScopeId,
|
|
87
|
+
type: 'SCOPE',
|
|
88
|
+
scopeType: 'catch-block',
|
|
89
|
+
semanticId: catchSemanticId,
|
|
90
|
+
file: ctx.module.file,
|
|
91
|
+
line: getLine(catchClause),
|
|
92
|
+
parentScopeId: catchBlockId // Parent is CATCH_BLOCK
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
// 4. Create FINALLY_BLOCK and finally-body SCOPE if finalizer exists
|
|
96
|
+
let finallyBlockId = null;
|
|
97
|
+
let finallyScopeId = null;
|
|
98
|
+
if (tryNode.finalizer) {
|
|
99
|
+
const finallyBlockCounter = ctx.finallyBlockCounterRef.value++;
|
|
100
|
+
const legacyFinallyBlockId = `${ctx.module.file}:FINALLY_BLOCK:${getLine(tryNode.finalizer)}:${finallyBlockCounter}`;
|
|
101
|
+
finallyBlockId = ctx.scopeTracker
|
|
102
|
+
? computeSemanticId('FINALLY_BLOCK', 'finally', ctx.scopeTracker.getContext(), { discriminator: finallyBlockCounter })
|
|
103
|
+
: legacyFinallyBlockId;
|
|
104
|
+
ctx.finallyBlocks.push({
|
|
105
|
+
id: finallyBlockId,
|
|
106
|
+
semanticId: finallyBlockId,
|
|
107
|
+
type: 'FINALLY_BLOCK',
|
|
108
|
+
file: ctx.module.file,
|
|
109
|
+
line: getLine(tryNode.finalizer),
|
|
110
|
+
column: getColumn(tryNode.finalizer),
|
|
111
|
+
parentScopeId: ctx.parentScopeId,
|
|
112
|
+
parentTryBlockId: tryBlockId
|
|
113
|
+
});
|
|
114
|
+
// Create finally-body SCOPE (backward compatibility)
|
|
115
|
+
finallyScopeId = `SCOPE#finally-block#${ctx.module.file}#${getLine(tryNode.finalizer)}:${ctx.scopeCounterRef.value++}`;
|
|
116
|
+
const finallySemanticId = analyzer.generateSemanticId('finally-block', ctx.scopeTracker);
|
|
117
|
+
ctx.scopes.push({
|
|
118
|
+
id: finallyScopeId,
|
|
119
|
+
type: 'SCOPE',
|
|
120
|
+
scopeType: 'finally-block',
|
|
121
|
+
semanticId: finallySemanticId,
|
|
122
|
+
file: ctx.module.file,
|
|
123
|
+
line: getLine(tryNode.finalizer),
|
|
124
|
+
parentScopeId: finallyBlockId // Parent is FINALLY_BLOCK
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
// 5. Push try scope onto stack for CONTAINS edges
|
|
128
|
+
if (ctx.scopeIdStack) {
|
|
129
|
+
ctx.scopeIdStack.push(tryScopeId);
|
|
130
|
+
}
|
|
131
|
+
// Enter try scope for semantic ID generation
|
|
132
|
+
if (ctx.scopeTracker) {
|
|
133
|
+
ctx.scopeTracker.enterCountedScope('try');
|
|
134
|
+
}
|
|
135
|
+
// 6. Store scope info for catch/finally transitions
|
|
136
|
+
ctx.tryScopeMap.set(tryNode, {
|
|
137
|
+
tryScopeId,
|
|
138
|
+
catchScopeId,
|
|
139
|
+
finallyScopeId,
|
|
140
|
+
currentBlock: 'try',
|
|
141
|
+
tryBlockId,
|
|
142
|
+
catchBlockId,
|
|
143
|
+
finallyBlockId
|
|
144
|
+
});
|
|
145
|
+
},
|
|
146
|
+
exit: (tryPath) => {
|
|
147
|
+
const tryNode = tryPath.node;
|
|
148
|
+
const _scopeInfo = ctx.tryScopeMap.get(tryNode);
|
|
149
|
+
// REG-311: Only decrement try block depth if we're still in 'try' block
|
|
150
|
+
// (not transitioned to catch/finally, where we already decremented)
|
|
151
|
+
if (ctx.controlFlowState && _scopeInfo?.currentBlock === 'try') {
|
|
152
|
+
ctx.controlFlowState.tryBlockDepth--;
|
|
153
|
+
}
|
|
154
|
+
// Pop the current scope from stack (could be try, catch, or finally)
|
|
155
|
+
if (ctx.scopeIdStack) {
|
|
156
|
+
ctx.scopeIdStack.pop();
|
|
157
|
+
}
|
|
158
|
+
// Exit the current scope
|
|
159
|
+
if (ctx.scopeTracker) {
|
|
160
|
+
ctx.scopeTracker.exitScope();
|
|
161
|
+
}
|
|
162
|
+
// Clean up
|
|
163
|
+
ctx.tryScopeMap.delete(tryNode);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
createCatchClauseVisitor() {
|
|
168
|
+
const ctx = this.ctx;
|
|
169
|
+
const analyzer = this.analyzer;
|
|
170
|
+
return {
|
|
171
|
+
enter: (catchPath) => {
|
|
172
|
+
const catchNode = catchPath.node;
|
|
173
|
+
const parent = catchPath.parent;
|
|
174
|
+
if (!t.isTryStatement(parent))
|
|
175
|
+
return;
|
|
176
|
+
const scopeInfo = ctx.tryScopeMap.get(parent);
|
|
177
|
+
if (!scopeInfo || !scopeInfo.catchScopeId)
|
|
178
|
+
return;
|
|
179
|
+
// Transition from try scope to catch scope
|
|
180
|
+
if (scopeInfo.currentBlock === 'try') {
|
|
181
|
+
// Pop try scope, push catch scope
|
|
182
|
+
if (ctx.scopeIdStack) {
|
|
183
|
+
ctx.scopeIdStack.pop();
|
|
184
|
+
ctx.scopeIdStack.push(scopeInfo.catchScopeId);
|
|
185
|
+
}
|
|
186
|
+
// Exit try scope, enter catch scope for semantic ID
|
|
187
|
+
if (ctx.scopeTracker) {
|
|
188
|
+
ctx.scopeTracker.exitScope();
|
|
189
|
+
ctx.scopeTracker.enterCountedScope('catch');
|
|
190
|
+
}
|
|
191
|
+
// REG-311: Decrement tryBlockDepth when leaving try block for catch
|
|
192
|
+
// Calls in catch block should NOT have isInsideTry=true
|
|
193
|
+
if (ctx.controlFlowState) {
|
|
194
|
+
ctx.controlFlowState.tryBlockDepth--;
|
|
195
|
+
}
|
|
196
|
+
scopeInfo.currentBlock = 'catch';
|
|
197
|
+
}
|
|
198
|
+
// Handle catch parameter (e.g., catch (e) or catch ({ message }))
|
|
199
|
+
if (catchNode.param) {
|
|
200
|
+
const errorVarInfo = analyzer.extractVariableNamesFromPattern(catchNode.param);
|
|
201
|
+
errorVarInfo.forEach(varInfo => {
|
|
202
|
+
const legacyId = `VARIABLE#${varInfo.name}#${ctx.module.file}#${varInfo.loc.start.line}:${varInfo.loc.start.column}:${ctx.varDeclCounterRef.value++}`;
|
|
203
|
+
const varId = ctx.scopeTracker
|
|
204
|
+
? computeSemanticId('VARIABLE', varInfo.name, ctx.scopeTracker.getContext())
|
|
205
|
+
: legacyId;
|
|
206
|
+
ctx.variableDeclarations.push({
|
|
207
|
+
id: varId,
|
|
208
|
+
type: 'VARIABLE',
|
|
209
|
+
name: varInfo.name,
|
|
210
|
+
file: ctx.module.file,
|
|
211
|
+
line: varInfo.loc.start.line,
|
|
212
|
+
parentScopeId: scopeInfo.catchScopeId
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
//# sourceMappingURL=TryC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AU,EAAE,CAAC;4BAC5E,CAAC,CAAC,QAAQ,CAAC;wBAEb,GAAG,CAAC,oBAAoB,CAAC,IAAI,CAAC;4BAC5B,EAAE,EAAE,KAAK;4BACT,IAAI,EAAE,UAAU;4BAChB,IAAI,EAAE,OAAO,CAAC,IAAI;4BAClB,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI;4BACrB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI;4BAC5B,aAAa,EAAE,SAAS,CAAC,YAAa;yBACvC,CAAC,CAAC;oBACL,CAAC,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VariableHandler — handles VariableDeclaration and AssignmentExpression nodes.
|
|
3
|
+
*
|
|
4
|
+
* Mechanical extraction from analyzeFunctionBody() (REG-422).
|
|
5
|
+
* Original source: JSASTAnalyzer.ts lines ~3765-3833.
|
|
6
|
+
*/
|
|
7
|
+
import type { Visitor } from '@babel/traverse';
|
|
8
|
+
import { FunctionBodyHandler } from './FunctionBodyHandler.js';
|
|
9
|
+
export declare class VariableHandler extends FunctionBodyHandler {
|
|
10
|
+
getHandlers(): Visitor;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=VariableHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VariableHandler.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/analysis/ast/handlers/VariableHandler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAY,MAAM,iBAAiB,CAAC;AAOzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,qBAAa,eAAgB,SAAQ,mBAAmB;IACtD,WAAW,IAAI,OAAO;CA4EvB"}
|