fix(javascript): preserve per-field publication and provenance coverage

This commit is contained in:
morluto
2026-10-24 03:01:43 +08:00
parent 2206822109
commit f1a9d85de5
8 changed files with 185 additions and 56 deletions
@@ -31,6 +31,7 @@ import { assignmentValueSources } from "./javascriptSemanticRequireOrigin.js";
import { semanticRuntimeExportValueSources } from "./javascriptModuleDeclaration.js";
import {
commonJsRuntimeExportValues,
commonJsExportApplicability,
indexCommonJsExportReceiversSteps,
type CommonJsExportReceiverEffect,
type CommonJsExportSite,
@@ -366,13 +367,14 @@ export const createSemanticElectronAppPathChangeQuery = (
commonJsReceivers ??= completeSemanticSteps(
indexCommonJsExportReceiversSteps(state),
);
return (
commonJsReceivers.get(node) !== "detached" &&
exported.some(
({ value, projection, ownEnumerable }) =>
value !== null &&
possiblePath(value, true, projection, ownEnumerable),
)
return exported.some(
({ exportedName, value, projection, ownEnumerable }) =>
commonJsExportApplicability(
commonJsReceivers.get(node),
exportedName,
) !== "detached" &&
value !== null &&
possiblePath(value, true, projection, ownEnumerable),
);
};
};