mirror of
https://github.com/morluto/rea
synced 2026-10-26 22:28:27 -04:00
fix(javascript): preserve effective child-process stdio options (#4336)
* fix(javascript): preserve effective child-process stdio options * fix(javascript): retain proven callbacks and primitive stdio keys * fix(javascript): preserve argv shapes and nullish spreads * fix(javascript): bound callable proofs and retain exposed binding uncertainty * test(javascript): keep callback acceptance within transport budget * test(javascript): inspect application coverage for callback proof limits * fix(javascript): keep spread command argument slots uncertain * fix(javascript): bound mapped argument content proofs * fix(javascript): distinguish erased declarations from runtime shadows * fix(javascript): prove runtime module context before binding isolation * fix(javascript): share erased declaration and opaque scope proofs * fix(javascript): keep lowered enum scopes opaque * fix(javascript): narrow stdio proofs and consolidate regressions * perf(javascript): reuse lexical references for child shapes * fix(javascript): retain CommonJS child argument context * fix(javascript): keep Annex B affected child arguments unknown * fix(javascript): recognize value import-equals runtime modules * fix(javascript): retain exact stdio through module and primitive syntax * fix(javascript): bound inline spread property resolution * fix(javascript): distinguish copied methods from getters
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { expect, it } from "vitest";
|
||||
import { expect, it, vi } from "vitest";
|
||||
import * as t from "@babel/types";
|
||||
|
||||
import {
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
classifyParsedJavaScriptElectronBindingsSteps,
|
||||
indexJavaScriptBindingsWithReceiversSteps,
|
||||
} from "./javascriptSemanticAnalysis.js";
|
||||
import * as semanticProjection from "./javascriptSemanticProjection.js";
|
||||
import { parseJavaScriptSource } from "./javascriptSourceParser.js";
|
||||
import { createJavaScriptGraphqlScan } from "./javascriptGraphqlOperations.js";
|
||||
import {
|
||||
@@ -273,3 +274,25 @@ conditionalAlias.handle("conditional-alias:ping", () => "local");
|
||||
[text.indexOf('require("electron")["ipcMain.handle"]'), []],
|
||||
]);
|
||||
});
|
||||
|
||||
it("reuses the lexical references during stepped child-argument analysis", () => {
|
||||
const parsed = parseJavaScriptSource(
|
||||
`
|
||||
import {spawn} from "node:child_process";
|
||||
const argv=[]; spawn("tool",argv,{stdio:"inherit"});
|
||||
`,
|
||||
"references.mjs",
|
||||
);
|
||||
if (parsed === null) throw new Error("Expected parsed source");
|
||||
const collector = vi.spyOn(semanticProjection, "collectSemanticReferences");
|
||||
try {
|
||||
const ir = completeSemanticSteps(
|
||||
analyzeParsedJavaScriptSemanticsSteps(parsed),
|
||||
);
|
||||
expect(ir.childProcessSpawns[0]?.stdioMode).toBe("inherit");
|
||||
expect(ir.references.some(({ name }) => name === "argv")).toBe(true);
|
||||
expect(collector).not.toHaveBeenCalled();
|
||||
} finally {
|
||||
collector.mockRestore();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user