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

This commit is contained in:
morluto
2026-10-20 17:18:18 +08:00
parent 599fdac029
commit 3b02179560
7 changed files with 180 additions and 13 deletions
@@ -1,5 +1,6 @@
import * as t from "@babel/types";
import { semanticComputedMethodKey } from "./javascriptSemanticEvaluationOrder.js";
import { semanticCallableIdForNode } from "./javascriptSemanticProjection.js";
/**
@@ -48,9 +49,7 @@ export const createSemanticCallableStack = <Callable>(
enter: (node, parent) => {
if (
parent !== null &&
(t.isObjectMethod(parent) || t.isClassMethod(parent)) &&
parent.computed &&
parent.key === node &&
semanticComputedMethodKey(parent, node) &&
frames.at(-1)?.callableId === semanticCallableIdForNode(parent)
) {
const method = pop();