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
@@ -50,7 +50,9 @@ cliTest.for(["CLI", "stdio MCP"] as const)(
Object.defineProperty(localClass,"x",{value:1});
const localRegExp = /local/;
Object.defineProperty(localRegExp,"x",{value:1});
${ROLLDOWN_MODULE_INTEROP}
const captured = Object.defineProperty;
Object.defineProperty = custom;
${ROLLDOWN_MODULE_INTEROP.replace("__defProp = Object.defineProperty", "__defProp = captured")}
let electron = require("electron");
electron = __toESM(electron, 1);
new electron.BrowserWindow({webPreferences:{preload:"./preload.js"}});