mirror of
https://github.com/morluto/rea.git
synced 2026-10-31 03:45:39 +00:00
fix(javascript): preserve uncertainty in compound assignment results (#4342)
* fix(javascript): preserve uncertainty in compound assignment results * fix(javascript): retain callable logical assignment alternatives * fix(javascript): read prior module export assignment values * fix: keep mutable module export assignment candidates conservative * fix: preserve mixed receiver values and wrapped assignment targets * fix: carry mutable export uncertainty through copied values
This commit is contained in:
1 parent
abbdb46427
commit
17488bd639
4 files changed
+705
-36
No files matched your search
@@ -57,6 +57,8 @@ export type SymbolicValue = (
|
||||
readonly kind: "namespace";
|
||||
readonly bindingId: string;
|
||||
readonly environment: SymbolicEnvironment;
|
||||
/** Namespace identity does not establish the mutable root's runtime value. */
|
||||
readonly runtimeValueUnknown?: true;
|
||||
}
|
||||
| {
|
||||
readonly kind: "loader";
|
||||
@@ -93,6 +95,7 @@ export const symbolicUnion = (
|
||||
return unique.length === 1 ? unique[0]! : { kind: "union", values: unique };
|
||||
};
|
||||
export const symbolicTruth = (value: SymbolicValue): boolean | undefined => {
|
||||
if (value.kind === "namespace" && value.runtimeValueUnknown) return undefined;
|
||||
if (value.kind === "union") {
|
||||
const choices = value.values.map(symbolicTruth);
|
||||
return choices.length > 0 &&
|
||||
|
||||
Reference in new issue
Block a user