fix(javascript): recover Electron API identity through aliases

Reuse semantic module provenance for aliases and keep property path segments intact through Electron matching. Reject shadowed names and nested or dotted lookalikes. Reassigned and conditionally initialized module origins remain ambiguous, with their source origins retained.

Add a compiled CLI/stdio MCP regression for windows, preloads, context bridges, IPC operations, pairing, and source ranges. Validate 771 JavaScript domain tests, seven composition tests, the public acceptance workflow, build, and check:fast.

Fixes #1656
This commit is contained in:
morluto
2026-10-11 08:27:46 +08:00
parent a11fbc0df9
commit 2612e474b6
14 changed files with 296 additions and 76 deletions
@@ -425,7 +425,7 @@ const propertyMatch = (node: ApplicationNode, field: string) => ({
const contextBridgeGraph = () => {
const analysis = analyzeJavaScriptStaticSource(
"contextBridge.exposeInMainWorld('desktopApi', { openProject() {}, closeProject() {} });",
"const { contextBridge } = require('electron');\ncontextBridge.exposeInMainWorld('desktopApi', { openProject() {}, closeProject() {} });",
);
expect(analysis.parse_status).toBe("complete");
const finding = analysis.electron.context_bridge_apis[0];