From 4bdfade8ef294c9f1b710fc981779a1fb8d50d0d Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Thu, 7 May 2026 19:29:56 +0200 Subject: [PATCH 1/2] test: remove usage of inherits --- test/parallel/test-event-capture-rejections.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/test/parallel/test-event-capture-rejections.js b/test/parallel/test-event-capture-rejections.js index de426996e0f538..6aa8f1fa1810c6 100644 --- a/test/parallel/test-event-capture-rejections.js +++ b/test/parallel/test-event-capture-rejections.js @@ -1,13 +1,7 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); -const { EventEmitter, captureRejectionSymbol } = require('events'); -const { inherits } = require('util'); - -// Inherits from EE without a call to the -// parent constructor. -function NoConstructor() { -} +const assert = require('node:assert'); +const { EventEmitter, captureRejectionSymbol } = require('node:events'); // captureRejections param validation { @@ -24,7 +18,7 @@ function NoConstructor() { }); } -inherits(NoConstructor, EventEmitter); +class NoConstructor extends EventEmitter {}; function captureRejections() { const ee = new EventEmitter({ captureRejections: true }); From 21c7fb4800e9b0dad1a5118ff199722a577a41eb Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Thu, 7 May 2026 19:29:56 +0200 Subject: [PATCH 2/2] test: remove usage of inherits Signed-off-by: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> --- test/parallel/test-event-capture-rejections.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/test/parallel/test-event-capture-rejections.js b/test/parallel/test-event-capture-rejections.js index de426996e0f538..6aa8f1fa1810c6 100644 --- a/test/parallel/test-event-capture-rejections.js +++ b/test/parallel/test-event-capture-rejections.js @@ -1,13 +1,7 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); -const { EventEmitter, captureRejectionSymbol } = require('events'); -const { inherits } = require('util'); - -// Inherits from EE without a call to the -// parent constructor. -function NoConstructor() { -} +const assert = require('node:assert'); +const { EventEmitter, captureRejectionSymbol } = require('node:events'); // captureRejections param validation { @@ -24,7 +18,7 @@ function NoConstructor() { }); } -inherits(NoConstructor, EventEmitter); +class NoConstructor extends EventEmitter {}; function captureRejections() { const ee = new EventEmitter({ captureRejections: true });