fix(javascript): preserve uncertain call targets across activation boundaries

This commit is contained in:
morluto committed 2026-10-20 17:18:18 +08:00
1 parent 599fdac029
commit 3b02179560
7 files changed
+180 -13

No files matched your search

@@ -13,6 +13,15 @@ export type JavaScriptSemanticIterationCardinality =
| "nonempty"
| "unknown";
/** Whether a method's computed key executes in the enclosing environment. */
export const semanticComputedMethodKey = (
parent: t.Node | undefined,
child: t.Node,
): boolean =>
(t.isObjectMethod(parent) || t.isClassMethod(parent)) &&
parent.computed &&
parent.key === child;
/** Exact source-only cardinality for literal loop heads. */
export const semanticIterationCardinality = (
loop: t.ForInStatement | t.ForOfStatement,