mirror of
https://github.com/morluto/rea.git
synced 2026-11-15 11:13:21 +00:00
fix(javascript): preserve per-field publication and provenance coverage
This commit is contained in:
1 parent
2206822109
commit
f1a9d85de5
8 files changed
+185
-56
No files matched your search
@@ -40,6 +40,7 @@ import {
|
||||
} from "./javascriptModuleDeclaration.js";
|
||||
import {
|
||||
commonJsRuntimeExportValues,
|
||||
commonJsExportApplicability,
|
||||
type CommonJsExportReceiverEffect,
|
||||
type CommonJsExportSite,
|
||||
} from "./javascriptCommonJsExportReceivers.js";
|
||||
@@ -468,17 +469,21 @@ const collectCommonJsExport = (
|
||||
state: JavaScriptSemanticAnalysisState,
|
||||
receiverEffect: CommonJsExportReceiverEffect | undefined,
|
||||
): void => {
|
||||
if (receiverEffect === "detached") return;
|
||||
// Compound and logical writes also depend on the previous value, so remain
|
||||
// unknown.
|
||||
for (const exported of commonJsRuntimeExportValues(node, state))
|
||||
// Compound and logical writes also depend on the previous value, so remain unknown.
|
||||
for (const exported of commonJsRuntimeExportValues(node, state)) {
|
||||
const applicability = commonJsExportApplicability(
|
||||
receiverEffect,
|
||||
exported.exportedName,
|
||||
);
|
||||
if (applicability === "detached") continue;
|
||||
addCommonJsExport(
|
||||
node,
|
||||
state,
|
||||
exported.exportedName,
|
||||
receiverEffect === "uncertain" ? null : exported.value,
|
||||
applicability === "uncertain" ? null : exported.value,
|
||||
exported.projection,
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const addCommonJsExport = (
|
||||
|
||||
Reference in new issue
Block a user