mirror of
https://github.com/morluto/rea.git
synced 2026-11-19 21:23:45 +00:00
fix(javascript): qualify releases after resource method mutation (#10166)
* fix(javascript): qualify releases after resource method mutation * fix(javascript): qualify releases after opaque receiver mutation * fix(javascript): preserve release ordering and mutation facts * fix(javascript): order mutations of fresh resource receivers * fix(javascript): match release mutations to captured receivers * fix(javascript): check delegated release method identity * fix(javascript): track paths back to native resource prototypes * fix(javascript): respect native release member ownership * fix(javascript): retain shared prototype effects across calls * fix(javascript): order release effects after definite acquisition * fix(javascript): preserve prototype effects across receiver replacement * fix(javascript): preserve native release identity across proven effects * fix(javascript): preserve shared prototype uncertainty after opaque calls --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
1 parent
2191896f3b
commit
caab34d0de
8 files changed
+812
-56
No files matched your search
@@ -1920,22 +1920,20 @@ export const semanticBindingEffectFollowsRead = (
|
||||
effect: t.Node,
|
||||
parents: WeakMap<t.Node, t.Node>,
|
||||
): boolean => {
|
||||
const initializer = binding.initializers[0];
|
||||
if (binding.initializers.length !== 1 || initializer === undefined)
|
||||
return false;
|
||||
const declaration = parents.get(initializer.node);
|
||||
// A logical/compound assignment may preserve a value from a prior call.
|
||||
if (
|
||||
!t.isVariableDeclarator(declaration) ||
|
||||
declaration.init !== initializer.node
|
||||
)
|
||||
return false;
|
||||
const initialized = initializerPosition(initializer, parents);
|
||||
const selected = bindingReadPosition(read, parents).position;
|
||||
return (
|
||||
initialized !== null &&
|
||||
selected !== null &&
|
||||
positionPrecedes(initialized, selected) &&
|
||||
binding.initializers.some((initializer) => {
|
||||
const declaration = parents.get(initializer.node);
|
||||
// Later assignments do not undo the declaration's reset each activation.
|
||||
if (
|
||||
!t.isVariableDeclarator(declaration) ||
|
||||
declaration.init !== initializer.node
|
||||
)
|
||||
return false;
|
||||
const initialized = initializerPosition(initializer, parents);
|
||||
return initialized !== null && positionPrecedes(initialized, selected);
|
||||
}) &&
|
||||
semanticReadPrecedesEffectWithinActivation(read, effect, parents)
|
||||
);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user