Closed Bug 1745372 Opened 3 years ago Closed 3 years ago

Implement AbortSignal.throwIfAborted

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
97 Branch
Tracking Status
firefox97 --- fixed

People

(Reporter: annevk, Assigned: evilpie)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

Convenience method for web developers writing signal-accepting operations.

Discussion: https://github.com/whatwg/dom/issues/927
Standard change: https://github.com/whatwg/dom/pull/1034
Tests: https://github.com/web-platform-tests/wpt/pull/31947

Assignee: nobody → evilpies
Depends on: 1737771
Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/autoland/rev/66f8b8d530f4 Implement AbortSignal.throwIfAborted. r=saschanaz,emilio
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch

FF97 docs work for this can be tracked in https://github.com/mdn/content/issues/11593

This is mostly just browser compatibility update and a page for this method: https://github.com/mdn/content/pull/11804

For the page I just used the simple async polling example from the spec (which checks the signal and throws on each iteration of a loop before executing the function again).

Are there any other cases where this might be useful? Is calling this method how a developer might "generically" implement an abort in their own APIs that take a signal?

Flags: needinfo?(evilpies)

Hey Hamish, yeah, that's correct. There's two examples in the specification to that effect:

Flags: needinfo?(evilpies)

Thanks very much @annevk. I've tried to capture that in https://github.com/mdn/content/pull/11907.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: