From 3f33b5a89ebbbbcd7a944213be9e60fe55c2a49a Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 24 Aug 2020 13:48:15 -0700 Subject: [PATCH] events: allow use of AbortController with on Signed-off-by: James M Snell PR-URL: https://github.com/nodejs/node/pull/34912 Backport-PR-URL: https://github.com/nodejs/node/pull/38386 Reviewed-By: Matteo Collina Reviewed-By: Benjamin Gruenbaum Reviewed-By: Denys Otrishko --- doc/api/events.md | 32 ++++- lib/events.js | 28 +++- test/parallel/test-event-on-async-iterator.js | 121 +++++++++++++++++- 3 files changed, 177 insertions(+), 4 deletions(-) diff --git a/doc/api/events.md b/doc/api/events.md index 09e435cd2963c3..e33413873c7126 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -1004,7 +1004,7 @@ Value: `Symbol.for('nodejs.rejection')` See how to write a custom [rejection handler][rejection]. -## `events.on(emitter, eventName)` +## `events.on(emitter, eventName[, options])`