Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2021-04-21 23:03:43 +0300
committerFeross Aboukhadijeh <feross@feross.org>2021-04-21 23:03:43 +0300
commite88feec495240675a439e4b0014dc65db7cd4a6f (patch)
treee197b53c9ef062716d8c6db5adb7a5ba8d154a53 /lib
parentf1047061fc8494c9569ac503c3ef732033636331 (diff)
FileStream: remove onclose argument to destroy()
This is a non-standard interface and it's confusing. It caused a bug in https://wormhole.app
Diffstat (limited to 'lib')
-rw-r--r--lib/file-stream.js7
1 files changed, 1 insertions, 6 deletions
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()
}
}