fix(javascript): keep overflowing timer delays unknown (#3456)

Normalize non-finite timer literals to the existing unknown value at the semantic fact producer. Keep timers, source provenance, binding resolution and unrelated functions; preserve all finite delay values.

Qualify shared CLI/MCP behavior with precise regression oracles, 111 tests, actual source fixtures, real-package summary/fact/Evidence workflows and current-main integration.

Fixes #3400.
This commit is contained in:
HawkForge
2026-10-20 21:02:38 +06:00
committed by GitHub
parent 7b2087e449
commit 8443692e2b
3 changed files with 131 additions and 1 deletions
@@ -73,6 +73,23 @@ describe("JavaScript semantic analysis: runtime boundaries 1", () => {
]);
});
it("keeps an overflowing timer delay unknown in a complete semantic result", () => {
const ir = analyzeJavaScriptSemantics(`
function greet() { return "hello"; }
setTimeout(() => greet(), 1e999);
`);
expect(ir.timerOperations).toEqual([
expect.objectContaining({
kind: "schedule",
method: "setTimeout",
delayMilliseconds: null,
resolution: "complete",
}),
]);
expect(ir.callables.some(({ name }) => name === "greet")).toBe(true);
});
it("does not treat shadowed timer globals as Node timers", () => {
const ir = analyzeJavaScriptSemantics(`
function run(setTimeout, clearTimeout) {