feat(javascript): discover semantic call literals in feature traces (#7840)

* feat(javascript): discover semantic call literals in feature traces

* fix(javascript): bound retained call literals by transfer capacity

* test(javascript): align feature no-match diagnostic
This commit is contained in:
morluto authored and GitHub committed 2026-10-29 01:25:23 +08:00
1 parent 685f6db960
commit f9e7571a3d
20 files changed
+681 -15

No files matched your search

@@ -0,0 +1,25 @@
import type { JavaScriptSemanticGraphNode } from "./javascriptSemanticGraphSchemas.js";
/** Read retained direct call literals without interpreting other node properties. */
export const semanticCallLiteralValues = (
node: JavaScriptSemanticGraphNode,
): (string | number | boolean | null)[] => {
if (node.kind !== "call-site" || !Array.isArray(node.properties.arguments))
return [];
return node.properties.arguments.flatMap((argument) => {
if (
argument === null ||
typeof argument !== "object" ||
Array.isArray(argument) ||
!Object.hasOwn(argument, "value")
)
return [];
const value = argument.value;
return value === null ||
typeof value === "string" ||
typeof value === "number" ||
typeof value === "boolean"
? [value]
: [];
});
};