fix(javascript): retain fresh function and class target identity

Recognize stable local function, undecorated class and RegExp targets before
widening intrinsic mutations. Keep decorated classes opaque because their
binding value can be replaced, and preserve class-initialization writes.
Cover fresh targets and replacement decorators in inert CLI/MCP fixtures.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
This commit is contained in:
N0zoM1z0
2026-10-11 15:41:00 +00:00
co-authored by factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Kaoru0822
parent 5569e96162
commit b03df22ce4
4 changed files with 34 additions and 5 deletions
+5 -3
View File
@@ -336,9 +336,11 @@ overwrite the global intrinsic identity. Arbitrary cross-call side effects are n
evaluated. Other reassignments, dynamic selections, and visibly overwritten
namespace members are unresolved.
Known Object/Reflect mutators remain recognizable through literal destructuring
of intrinsic objects. Stable identifier chains to object/array literals keep those
targets separate from intrinsic objects when initialized before use; opaque,
reassigned or not-yet-initialized targets remain unresolved.
of intrinsic objects. Stable identifier chains to fresh object, array, function,
undecorated class or RegExp syntax keep those targets separate from intrinsic
objects when initialized before use; opaque, decorated, reassigned or
not-yet-initialized targets remain unresolved. Writes during class initialization
are still retained.
Direct and destructuring assignment, loop, update, and delete targets are checked
through namespace aliases; unrelated member writes do not discard observed API
identity. This static check does