diff --git a/lib/internal/streams/destroy.js b/lib/internal/streams/destroy.js index 6eb46c7f7c454e..d55694b3106b3b 100644 --- a/lib/internal/streams/destroy.js +++ b/lib/internal/streams/destroy.js @@ -1,18 +1,10 @@ 'use strict'; -// Undocumented cb() API, needed for core, not for public API. -// The cb() will be invoked synchronously if _destroy is synchronous. -// If cb is passed no 'error' event will be emitted. -function destroy(err, cb) { +function destroy(err) { const r = this._readableState; const w = this._writableState; if ((w && w.destroyed) || (r && r.destroyed)) { - if (typeof cb === 'function') { - // TODO(ronag): Invoke with `'close'`/`'error'`. - cb(); - } - return this; } @@ -52,10 +44,6 @@ function destroy(err, cb) { r.closed = true; } - if (typeof cb === 'function') { - cb(err); - } - if (err) { process.nextTick(emitErrorCloseNT, this, err); } else {