infernoflow 0.32.7 → 0.32.8
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.
|
@@ -48,7 +48,8 @@ function buildGraph(scanCaps, allCaps) {
|
|
|
48
48
|
const reverse = {};
|
|
49
49
|
|
|
50
50
|
// Build function → capId index
|
|
51
|
-
|
|
51
|
+
// Use Map (not plain object) to avoid collisions with inherited properties like toString, constructor, etc.
|
|
52
|
+
const funcIndex = new Map(); // functionName → capId
|
|
52
53
|
for (const entry of scanCaps) {
|
|
53
54
|
const capFull = allCaps.find(c => c.id === entry.id) || {};
|
|
54
55
|
nodes[entry.id] = {
|
|
@@ -66,8 +67,8 @@ function buildGraph(scanCaps, allCaps) {
|
|
|
66
67
|
|
|
67
68
|
for (const fn of (entry.codeAnalysis?.functions || [])) {
|
|
68
69
|
const bare = fn.replace(/\(\)$/, "");
|
|
69
|
-
funcIndex
|
|
70
|
-
funcIndex
|
|
70
|
+
funcIndex.set(bare, entry.id);
|
|
71
|
+
funcIndex.set(bare.toLowerCase(), entry.id);
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
|
|
@@ -75,7 +76,7 @@ function buildGraph(scanCaps, allCaps) {
|
|
|
75
76
|
for (const [capId, node] of Object.entries(nodes)) {
|
|
76
77
|
for (const call of node.calls) {
|
|
77
78
|
const bare = call.replace(/\(\)$/, "");
|
|
78
|
-
const target = funcIndex
|
|
79
|
+
const target = funcIndex.get(bare) || funcIndex.get(bare.toLowerCase());
|
|
79
80
|
if (target && target !== capId) {
|
|
80
81
|
edges[capId].add(target);
|
|
81
82
|
reverse[target].add(capId);
|