Parent ABI work: #329 Tracked by: #134 and #246 Profiles: #164 (Bun-only private export)
Problem
The Bun profile declares WebCore__AbortSignal__getTimeout, but its return value is a borrowed pointer to an event-loop-owned AbortSignal.Timeout, not an opaque marker. A correct implementation also requires the JavaScript AbortSignal.timeout(milliseconds) path, timer scheduling, cancellation, firing, test-isolation generation, and exact ref balancing. Returning a decorative pointer or always-null stub would make the audit misleading.
Scope
- Implement standards-correct
AbortSignal.timeout(milliseconds)without blocking the calling agent. - Add an event-loop timer record with a monotonic deadline, cancellation, firing, and teardown.
- Keep the timeout signal alive until it fires or becomes unobservable, then release the extra native ref exactly once.
- Make every abort path cancel and invalidate the borrowed timeout handle before callbacks/events can observe stale state.
- Implement Bun-profile
WebCore__AbortSignal__getTimeoutwith the pinned borrowed-pointer layout and lifetime contract. - Exercise natural firing, early abort, observer removal, teardown, generation isolation, and deadline inspection.
- Refresh the Bun inventory and runtime fixture; Home must retain its 14-symbol AbortSignal surface without this Bun-only export.
Acceptance
- Timeout signals abort asynchronously with
TimeoutErrorat the scheduled deadline and never keep the event loop alive by themselves. getTimeoutis non-null only while the timer is active and returns the exact event-loop record consumed by the pinned Bun profile.- Fire/cancel/abort/teardown races cannot double-unref, use freed timer memory, or dispatch into a replaced realm.
- No blocking sleep is used to emulate the timer.
- Focused timer/ABI tests and one descendant full CI matrix are green.