Skip to content
This repository has been archived by the owner on Nov 12, 2023. It is now read-only.

Commit

Permalink
finish event -> _finish
Browse files Browse the repository at this point in the history
  • Loading branch information
davedoesdev committed Apr 3, 2020
1 parent 3d2aafd commit 1a26c5e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions test/memory-duplex.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ function RightDuplex(left, options)
{
Duplex.call(this, options);
this.left = left;
this.on('finish', function ()
{
left.push(null);
});
this._orig_emit = this.emit;
this.emit = function (type)
{
Expand All @@ -27,6 +23,12 @@ function RightDuplex(left, options)

util.inherits(RightDuplex, Duplex);

RightDuplex.prototype._final = function (cb)
{
this.left.push(null);
cb();
};

RightDuplex.prototype._read = function ()
{
if (this._cb)
Expand All @@ -53,10 +55,6 @@ function LeftDuplex(options)
{
Duplex.call(this, options);
this.right = new RightDuplex(this, options);
this.on('finish', function ()
{
this.right.push(null);
});
this._orig_emit = this.emit;
this.emit = function (type)
{
Expand All @@ -76,6 +74,11 @@ function LeftDuplex(options)

util.inherits(LeftDuplex, Duplex);

LeftDuplex.prototype._final = function (cb)
{
this.right.push(null);
};

LeftDuplex.prototype._read = function ()
{
if (this._cb)
Expand Down

0 comments on commit 1a26c5e

Please sign in to comment.