summaryrefslogtreecommitdiff
path: root/lib/_stream_readable.js
diff options
context:
space:
mode:
authorRobert Nagy <ronagy@icloud.com>2019-09-07 23:29:18 +0200
committerRich Trott <rtrott@gmail.com>2019-09-22 18:05:54 -0700
commit1665a9330c0fa9f4a79c900e6250938ac8d7a9e5 (patch)
treee5830774edc0e9eacb39ea9e28244be6d5de9ea5 /lib/_stream_readable.js
parent34a61d563088c97f13e193d00c91cd893f1479b8 (diff)
downloadandroid-node-v8-1665a9330c0fa9f4a79c900e6250938ac8d7a9e5.tar.gz
android-node-v8-1665a9330c0fa9f4a79c900e6250938ac8d7a9e5.tar.bz2
android-node-v8-1665a9330c0fa9f4a79c900e6250938ac8d7a9e5.zip
stream: apply special logic in removeListener for readable.off()
We have special logic in removeListener() which must apply to off() as well. PR-URL: https://github.com/nodejs/node/pull/29486 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'lib/_stream_readable.js')
-rw-r--r--lib/_stream_readable.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js
index 2dc1323f09..eb7d5011d4 100644
--- a/lib/_stream_readable.js
+++ b/lib/_stream_readable.js
@@ -918,6 +918,7 @@ Readable.prototype.removeListener = function(ev, fn) {
return res;
};
+Readable.prototype.off = Readable.prototype.removeListener;
Readable.prototype.removeAllListeners = function(ev) {
const res = Stream.prototype.removeAllListeners.apply(this, arguments);