mirror of
https://github.com/morluto/rea
synced 2026-10-27 14:42:18 -04:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user