* fix(javascript): retain Electron switch conditions * fix(javascript): bound switch path traversal
2179 lines
75 KiB
TypeScript
2179 lines
75 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { analyzeJavaScriptStaticSource } from "./javascriptStaticAnalysis.js";
|
|
|
|
it("retains switch selection on a direct bridge exposure", () => {
|
|
const result = analyzeJavaScriptStaticSource(`
|
|
const { contextBridge, ipcRenderer } = require("electron");
|
|
switch (process.platform) {
|
|
case "win32":
|
|
contextBridge.exposeInMainWorld("api", { ping: () => ipcRenderer.invoke("ping") });
|
|
}
|
|
`);
|
|
expect(result.electron.call_paths?.[0 |