fix(javascript): track public CommonJS export receiver lifetimes (#3567)

* fix(javascript): track public CommonJS export receiver lifetimes

* fix(javascript): retain exports across uncertain identity effects
This commit is contained in:
鸡哥 authored and GitHub committed 2026-10-15 02:46:14 +08:00
1 parent 357996cc89
commit 75104040df
10 files changed
+502 -71

No files matched your search

@@ -128,7 +128,9 @@ export function* collectJavaScriptIdentityWritesSteps(
if (identities.length > 0) {
const key = keyedMutators.has(method ?? "")
? [staticString(arguments_?.[1]) ?? null]
: [];
: // Mutating a target's contents does not replace the target.
// Retain an unknown child key, rather than its own identity.
[null];
for (const identity of identities)
retain(node, [...identity, ...key]);
} else if (!freshObject(target)) {