From e88feec495240675a439e4b0014dc65db7cd4a6f Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 21 Apr 2021 13:03:43 -0700 Subject: FileStream: remove onclose argument to destroy() This is a non-standard interface and it's confusing. It caused a bug in https://wormhole.app --- lib/file-stream.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/file-stream.js b/lib/file-stream.js index bd9728d..f9cd462 100644 --- a/lib/file-stream.js +++ b/lib/file-stream.js @@ -85,11 +85,7 @@ class FileStream extends stream.Readable { this._piece += 1 } - destroy (onclose) { - this._destroy(null, onclose) - } - - _destroy (err, onclose) { + _destroy (err) { if (this.destroyed) return this.destroyed = true @@ -99,7 +95,6 @@ class FileStream extends stream.Readable { if (err) this.emit('error', err) this.emit('close') - if (onclose) onclose() } } -- cgit v1.2.3