fix(javascript): preserve intrinsic alias capture timing

Validate each alias read after initialization and retain the original function capture across copies. Share declaration initializer facts with RPC and Electron analysis, including class declarations used for fresh-target identity. Accept single-statement control blocks while keeping lexical roles and added operations checked. Cover the capture regressions through inert source and public CLI/MCP workflows.
This commit is contained in:
morluto
2026-10-11 23:53:55 +08:00
parent b03df22ce4
commit 548a4334c4
7 changed files with 221 additions and 68 deletions
+11 -8
View File
@@ -326,15 +326,18 @@ remain unknown and make coverage partial.
Electron API identity follows proven lexical module aliases. Namespace interop
also preserves identity when the complete Rolldown helper operations, lexical
roles, live getters, and captured intrinsic origins match, or when a stable
helper simply returns its module parameter. Recognition uses structure rather
than emitted names; other helper bodies and ambiguous runtime fallbacks remain
unresolved. Captured function identities survive later global-property
replacement. Visible intrinsic writes before capture or conversion are checked
in their owning callable scope, including identifier leaves in nested/default/rest
helper simply returns its module parameter. Harmless single-statement control
blocks preserve recognition; added operations still require proof. Recognition
uses structure rather than emitted names; other helper bodies and ambiguous
runtime fallbacks remain unresolved. Captured function identities survive later global-property
replacement, including copies through initialized aliases. Reads before an
alias initializer remain unresolved. Visible intrinsic writes before capture or
conversion are checked in their owning callable scope, including identifier leaves in nested/default/rest
destructuring and loop targets. Property keys and shadowed local bindings do not
overwrite the global intrinsic identity. Arbitrary cross-call side effects are not
evaluated. Other reassignments, dynamic selections, and visibly overwritten
namespace members are unresolved.
overwrite the global intrinsic identity. Cross-call side effects, including
writes inside directly invoked local functions, are not 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 fresh object, array, function,
undecorated class or RegExp syntax keep those targets separate from intrinsic