Browse Source

stream: Override addListener as well as on

For the compatibility switch.
v0.9.6-release
isaacs 12 years ago
parent
commit
18c985919d
  1. 2
      lib/_stream_readable.js

2
lib/_stream_readable.js

@ -510,7 +510,7 @@ Readable.prototype.unpipe = function(dest) {
// kludge for on('data', fn) consumers. Sad. // kludge for on('data', fn) consumers. Sad.
// This is *not* part of the new readable stream interface. // This is *not* part of the new readable stream interface.
// It is an ugly unfortunate mess of history. // It is an ugly unfortunate mess of history.
Readable.prototype.on = function(ev, fn) { Readable.prototype.addListener = Readable.prototype.on = function(ev, fn) {
var res = Stream.prototype.on.call(this, ev, fn); var res = Stream.prototype.on.call(this, ev, fn);
// https://github.com/isaacs/readable-stream/issues/16 // https://github.com/isaacs/readable-stream/issues/16

Loading…
Cancel
Save