fix(javascript): consume per-field CommonJS publication facts

This commit is contained in:
morluto
2026-10-24 03:15:24 +08:00
parent 562966500f
commit 9c4d194f14
2 changed files with 14 additions and 10 deletions
@@ -364,15 +364,13 @@ export const createSemanticElectronAppPathChangeQuery = (
(!t.isAssignmentExpression(node) && !t.isCallExpression(node))
)
return false;
commonJsReceivers ??= completeSemanticSteps(
const receivers = (commonJsReceivers ??= completeSemanticSteps(
indexCommonJsExportReceiversSteps(state),
);
));
return exported.some(
({ exportedName, value, projection, ownEnumerable }) =>
commonJsExportApplicability(
commonJsReceivers.get(node),
exportedName,
) !== "detached" &&
commonJsExportApplicability(receivers.get(node), exportedName) !==
"detached" &&
value !== null &&
possiblePath(value, true, projection, ownEnumerable),
);