refactor(javascript): remove analysis ceilings

This commit is contained in:
morluto
2026-09-29 15:30:43 +08:00
parent 60cb68a276
commit 9aec6908b5
39 changed files with 249 additions and 534 deletions
+1 -5
View File
@@ -48,7 +48,6 @@ interface PromiseExpressionResolutionContext {
readonly candidateByNode: WeakMap<t.Node, PromiseCandidate>;
readonly state: JavaScriptSemanticAnalysisState;
readonly seenBindings: ReadonlySet<string>;
readonly depth: number;
}
interface PromiseOwnershipContext {
@@ -388,8 +387,7 @@ const resolvePromiseExpression = (
rawNode: t.Node,
context: PromiseExpressionResolutionContext,
): PromiseResolution => {
const { current, candidateByNode, state, seenBindings, depth } = context;
if (depth >= state.limits.maxValueDepth) return unresolvedPromise();
const { current, candidateByNode, state, seenBindings } = context;
const node = unwrapExpression(rawNode);
const direct = candidateByNode.get(node);
if (direct !== undefined && direct.promiseId !== current.promiseId)
@@ -411,7 +409,6 @@ const resolvePromiseExpression = (
return resolvePromiseExpression(initializer.node, {
...context,
seenBindings: nestedSeen,
depth: depth + 1,
});
};
@@ -424,7 +421,6 @@ const promiseResolutionContext = (
candidateByNode,
state,
seenBindings: new Set(),
depth: 0,
});
const unwrapExpression = (node: t.Node): t.Node => {