mirror of
https://github.com/morluto/rea.git
synced 2026-10-29 10:55:57 +00:00
fix(javascript): preserve initializer execution and lexical ownership
This commit is contained in:
1 parent
5cbcd58550
commit
fba4faf88a
8 files changed
+488
-41
No files matched your search
@@ -658,12 +658,16 @@ const evaluateExpressionValue = (
|
||||
const binding = resolveSemanticBindingState(context.state, node, node.name);
|
||||
if (binding === undefined)
|
||||
return { status: "unknown", reason: `Unbound identifier ${node.name}.` };
|
||||
const read =
|
||||
const read = semanticBindingAtRead(
|
||||
binding,
|
||||
node,
|
||||
context.state.parentsByNode,
|
||||
);
|
||||
if (
|
||||
read.status === "unresolved" &&
|
||||
binding.mutable &&
|
||||
binding.definitions.some(({ kind }) => kind === "assignment")
|
||||
? semanticBindingAtRead(binding, node, context.state.parentsByNode)
|
||||
: undefined;
|
||||
if (read?.status === "unresolved") {
|
||||
) {
|
||||
const value = evaluateBinding(binding, nestedContext(context));
|
||||
if (
|
||||
value.status === "unknown" ||
|
||||
@@ -676,7 +680,7 @@ const evaluateExpressionValue = (
|
||||
reason: `Binding ${binding.name} has unresolved ordering at this read.`,
|
||||
};
|
||||
}
|
||||
const atRead = read?.binding ?? binding;
|
||||
const atRead = read.binding;
|
||||
if (
|
||||
semanticOpaqueBindingReadMayHaveChanged(
|
||||
binding,
|
||||
|
||||
Reference in new issue
Block a user