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
@@ -368,7 +368,11 @@ const timerDelay = (candidate: TimerCandidate): number | null => {
if (candidate.kind !== "schedule" || candidate.method === "setImmediate")
return null;
const delay = candidate.node.arguments[1];
return t.isNumericLiteral(delay) ? delay.value : null;
// An overflowing literal such as 1e999 parses to Infinity, which JSON
// Evidence cannot carry; keep that delay unknown like any other.
return t.isNumericLiteral(delay) && Number.isFinite(delay.value)
? delay.value
: null;
};
const timerId = (candidate: TimerCandidate): string =>