From 2bda6061bd9825d3de8b40f87d682d750d53c49f Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Wed, 6 Dec 2023 09:29:30 +0100 Subject: [PATCH] refactor: remove some node compat --- lib/api/readable.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/lib/api/readable.js b/lib/api/readable.js index 356a03aedd9..cd18a77cdaa 100644 --- a/lib/api/readable.js +++ b/lib/api/readable.js @@ -46,11 +46,6 @@ module.exports = class BodyReadable extends Readable { } destroy (err) { - if (this.destroyed) { - // Node < 16 - return this - } - if (!err && !this._readableState.endEmitted) { err = new RequestAbortedError() } @@ -74,17 +69,6 @@ module.exports = class BodyReadable extends Readable { }) } - emit (ev, ...args) { - if (ev === 'data') { - // Node < 16.7 - this._readableState.dataEmitted = true - } else if (ev === 'error') { - // Node < 16 - this._readableState.errorEmitted = true - } - return super.emit(ev, ...args) - } - on (ev, ...args) { if (ev === 'data' || ev === 'readable') { this[kReading] = true