Resolves with the result of f, or with the result of g if f does not settle within wait milliseconds.
Waits above the setTimeout maximum (2^31-1 ms) are honoured by chaining timers; a non-finite wait never times out.
Aborting signal clears the timer and rejects with signal.reason; the
promise returned by f is left to settle on its own (its result is
dropped), so pass the same signal to f when its work should stop too.
Resolves with the result of
f, or with the result ofgiffdoes not settle withinwaitmilliseconds. Waits above thesetTimeoutmaximum (2^31-1 ms) are honoured by chaining timers; a non-finite wait never times out.Aborting
signalclears the timer and rejects withsignal.reason; the promise returned byfis left to settle on its own (its result is dropped), so pass the same signal tofwhen its work should stop too.