mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-10 01:56:15 +08:00
timers/promises setTimeout(delay, value) and setImmediate(value) were refused: only the void forms lowered. The value now travels as an already-resolved promise of its own type (the Promise.resolve lowering), and scr_tp_set_timeout_value / scr_tp_set_immediate_value copy its settlement into the result when the timer or immediate fires, so the result keeps the value's type. An options object literal takes `ref`; `ref: false` unrefs the timer, so it no longer keeps the process alive. AbortSignal options and other option forms stay refused, with their own messages. @types/node types setInterval as NodeJS.AsyncIterator<T>, which maps to no IR type, so a for await loop over setInterval(delay, value) was refused in projects with @types/node. The interval's async generator type now comes from the iterator's type argument, and a for await loop whose head is that call consumes it directly. The fallback declarations type the new forms.