Skip to content

Commit

Permalink
refactor: remove some node compat (nodejs#2502)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag authored and crysmags committed Feb 27, 2024
1 parent e31917d commit fb669e7
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions lib/api/readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand All @@ -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
Expand Down

0 comments on commit fb669e7

Please sign in to comment.