feat(javascript): add local semantic call flow

This commit is contained in:
morluto
2026-07-22 23:22:55 +00:00
parent 74d1c7b274
commit a26a1c73df
8 changed files with 864 additions and 7 deletions
+10
View File
@@ -55,6 +55,10 @@ export const collectSemanticReturns = (
}
retained += 1;
sites.push({
returnSiteId: semanticReturnSiteId(
callable.callableId,
expression.location,
),
location: expression.location,
value:
expression.node === null
@@ -76,6 +80,12 @@ export const collectSemanticReturns = (
});
};
const semanticReturnSiteId = (
callableId: string,
location: JavaScriptSemanticReturnSite["location"],
): string =>
`${callableId}:return:${String(location.start.line)}:${String(location.start.column)}:${String(location.end.line)}:${String(location.end.column)}`;
/** Link exports to callables only when lexical resolution is unique and exact. */
export const resolveSemanticModuleCallables = (
state: JavaScriptSemanticAnalysisState,