From b10cd7cccc248877779f3f13ebc74c28a7b6a616 Mon Sep 17 00:00:00 2001 From: Feng Yu Date: Tue, 14 Jun 2022 06:18:24 +0000 Subject: [PATCH] squash: use EventEmitter.captureRejections = true --- doc/api/events.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/events.md b/doc/api/events.md index cb301bd5b36427..ff6b412cf4282b 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -232,10 +232,10 @@ Setting `events.captureRejections = true` will change the default for all new instances of `EventEmitter`. ```mjs -import * as events from 'node:events'; +import { EventEmitter } from 'node:events'; -events.captureRejections = true; -const ee1 = new events.EventEmitter(); +EventEmitter.captureRejections = true; +const ee1 = new EventEmitter(); ee1.on('something', async (value) => { throw new Error('kaboom'); });