Skip to content

Commit

Permalink
refactor: remove some node compat (#2502)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Dec 7, 2023
1 parent c009d6a commit 84a99b0
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 84a99b0

Please sign in to comment.