fix(javascript): resolve preceding exported variable initializers and computed method keys (#5387)

fix(javascript): resolve variable initializers before computed method keys
This commit is contained in:
Ahmed authored and GitHub committed 2026-10-27 21:31:59 +08:00
1 parent b4118b9683
commit cbeeeda97b
3 files changed
+86 -2

No files matched your search

@@ -131,7 +131,12 @@ export const semanticTopLevelEffectFollowsCapture = (
let declarator: t.VariableDeclarator | undefined;
let child: t.Node | undefined;
while (node !== undefined) {
if (t.isFunction(node) || t.isLoop(node)) return null;
if (
(t.isFunction(node) &&
(child === undefined || !semanticComputedMethodKey(node, child))) ||
t.isLoop(node)
)
return null;
if (delayedInstanceFieldValue(node, child)) return null;
if (t.isVariableDeclarator(node)) declarator = node;
if (t.isStatement(node)) {