fix(javascript): retain Reflect set receiver effects

This commit is contained in:
morluto
2026-10-12 01:01:18 +08:00
parent ad27b8b4ff
commit c98d326514
4 changed files with 46 additions and 18 deletions
@@ -36,6 +36,7 @@ const INTRINSIC_MUTATIONS = [
"bound.cjs",
'const change = Object.defineProperty.bind(null,Object,"create"); change({value:customCreate});',
],
["receiver.cjs", 'Reflect.set({},"create",customCreate,Object);'],
] as const;
cliTest.for(["CLI", "stdio MCP"] as const)(
@@ -103,6 +104,7 @@ cliTest.for(["CLI", "stdio MCP"] as const)(
require("./uncurried.cjs");
require("./generic-bind.cjs");
require("./replaced-apply.cjs");
require("./receiver.cjs");
throw new Error("must not execute main");
`;
await writeFile(join(root, "main.cjs"), source);
@@ -129,7 +131,7 @@ cliTest.for(["CLI", "stdio MCP"] as const)(
preload_entrypoints: 1,
});
expect(result.statistics.parse_failures).toBe(0);
expect(result.statistics.parsed_javascript_files).toBe(9);
expect(result.statistics.parsed_javascript_files).toBe(10);
const windows = result.graph.nodes.filter(
({ kind }) => kind === "browser-window",
);