diff options
author | James M Snell <jasnell@gmail.com> | 2021-11-24 18:28:30 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2021-12-10 18:51:41 +0300 |
commit | 3f72c72bbb89154bc15fbcef7ccbe3cf0dd017ba (patch) | |
tree | f00850045d79c068969f28771f6a7b9776788544 /doc/api/globals.md | |
parent | 03c983745706c4b05ff5579dcd4870f89d799d4b (diff) |
lib: add abortSignal.throwIfAborted()
Refs: https://github.com/whatwg/dom/pull/1034
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/40951
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'doc/api/globals.md')
-rw-r--r-- | doc/api/globals.md | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/api/globals.md b/doc/api/globals.md index 3e47237714f..9df487a786a 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -191,6 +191,14 @@ ac.abort(new Error('boom!')); console.log(ac.signal.reason); // Error('boom!'); ``` +#### `abortSignal.throwIfAborted()` + +<!-- YAML +added: REPLACEME +--> + +If `abortSignal.aborted` is `true`, throws `abortSignal.reason`. + ## Class: `Buffer` <!-- YAML |