AbortSignal
Generated from idl/dom.webidl when the site was built at 7aa23e2.
AbortSignal is an interface in idl/dom.webidl, inheriting EventTarget, exposed in Window, Worker. What it does is on MDN; this page says what niso has of it.
timeout() and any() are the binding’s: timeout() waits on the DOM’s timers and makes its TimeoutError when the timer fires, and any() reads its signals and builds the result with create() and addSource().
Status
Section titled “Status”The web features its members belong to, each with its Baseline status on the web and how much of the feature’s WPT suite passes in niso (see Web platform support).
| Feature | On the web | In niso | Members |
|---|---|---|---|
| AbortController and AbortSignal | Widely available | Partial 97% 70 of 72 subtests pass | 5 |
Members
Section titled “Members”abort()
Section titled “abort()”[NewObject] static AbortSignal abort(optional [NisoHeld] any reason);int32_t niso_abort_signal_abort(niso_dom* dom, niso_held reason, niso_handle* out);aborted
Section titled “aborted”readonly attribute boolean aborted;int32_t niso_abort_signal_get_aborted(niso_dom* dom, niso_handle self, bool* out);reason
Section titled “reason”readonly attribute [NisoHeld] any reason;int32_t niso_abort_signal_get_reason(niso_dom* dom, niso_handle self, void** out);Null until the signal is aborted; the JS binding reports undefined.
throwIfAborted()
Section titled “throwIfAborted()”undefined throwIfAborted();int32_t niso_abort_signal_throw_if_aborted(niso_dom* dom, niso_handle self);onabort
Section titled “onabort”attribute EventHandler onabort;int32_t niso_abort_signal_get_onabort(niso_dom* dom, niso_handle self, void** out);int32_t niso_abort_signal_set_onabort(niso_dom* dom, niso_handle self, niso_event_handler_non_null_fn value_fn, void* value_userdata, niso_drop_fn value_drop);create()
Section titled “create()”[NisoInternal, NewObject] static AbortSignal create(boolean dependent);int32_t niso_abort_signal_create(niso_dom* dom, bool dependent, niso_handle* out);A new signal that is not aborted. DOM’s “create a dependent abort signal”, after its check for an already aborted signal, is a new dependent one, then addSource() with each signal in turn.
addSource()
Section titled “addSource()”[NisoInternal] undefined addSource(AbortSignal signal);int32_t niso_abort_signal_add_source(niso_dom* dom, niso_handle self, niso_handle signal);addAlgorithm()
Section titled “addAlgorithm()”[NisoInternal] unsigned long addAlgorithm(AbortAlgorithm algorithm);int32_t niso_abort_signal_add_algorithm(niso_dom* dom, niso_handle self, niso_abort_algorithm_fn algorithm_fn, void* algorithm_userdata, niso_drop_fn algorithm_drop, uint32_t* out);DOM’s “add” an abort algorithm, which runs before the abort event and gets the signal: its id for removeAlgorithm, or 0 when the signal can never abort and the algorithm is dropped.
removeAlgorithm()
Section titled “removeAlgorithm()”[NisoInternal] static undefined removeAlgorithm(unsigned long id);int32_t niso_abort_signal_remove_algorithm(niso_dom* dom, uint32_t id);DOM’s “remove” an abort algorithm, from whichever signal holds it.
signalAbort()
Section titled “signalAbort()”[NisoInternal, NisoReentrant] undefined signalAbort(optional [NisoHeld] any reason);int32_t niso_abort_signal_signal_abort(niso_dom* dom, niso_handle self, niso_held reason);DOM’s “signal abort”.
Not in niso yet
Section titled “Not in niso yet”Members the web has, by the BCD keys web-features 3.45.0 lists, that idl/ doesn’t declare. The list is partial: web-features lists only the keys it maps to a feature.
abort_static(AbortController and AbortSignal)any_static(AbortSignal.any())timeout_static(AbortSignal.timeout())