mirror of
https://github.com/morluto/rea
synced 2026-10-28 15:07:26 -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:
@@ -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 =>
|
||||
|
||||
Reference in New Issue
Block a user