From 0b60272686799550121898768c4bbcec37092d48 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 10 Mar 2021 08:59:52 -0800 Subject: [PATCH 1/2] lib: implement AbortSignal.abort() Refs: https://github.com/whatwg/dom/pull/960 --- .eslintrc.js | 1 + doc/api/globals.md | 9 +++++++++ lib/internal/abort_controller.js | 8 ++++++-- test/parallel/test-abortcontroller.js | 5 +++++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 291436cdc4f9b5..7574e1b4b6c7f7 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -315,6 +315,7 @@ module.exports = { }, globals: { AbortController: 'readable', + AbortSignal: 'readable', Atomics: 'readable', BigInt: 'readable', BigInt64Array: 'readable', diff --git a/doc/api/globals.md b/doc/api/globals.md index 6144c662a22821..079a63be696a71 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -67,6 +67,15 @@ added: v15.0.0 The `AbortSignal` is used to notify observers when the `abortController.abort()` method is called. +#### Static method: `AbortSignal.abort()` + + +* Returns: {AbortSignal} + +Returns a new already aborted `AbortSignal`. + #### Event: `'abort'`