From 263bf4e2e7679ecd1324a88d4bd131afa63075b5 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 10 Mar 2021 08:59:52 -0800 Subject: [PATCH] lib: implement AbortSignal.abort() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://github.com/whatwg/dom/pull/960 PR-URL: https://github.com/nodejs/node/pull/37693 Reviewed-By: Antoine du Hamel Reviewed-By: Michaƫl Zasso Reviewed-By: Benjamin Gruenbaum --- .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 be3c6d6ad9a439..7b8c7249f57822 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'`