Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

zlib: Emit "end" instead of "close" for Z_STREAM_END

Emit "end" instead of "close" when Z_STREAM_END return value is
encountered. And remove emitting "end" in Zlib.end().
  • Loading branch information...
commit 3efc53209fc214c936c027f02587f21c5bcbfe1a 1 parent 45cb346
Yi EungJun authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  lib/zlib.js
3  lib/zlib.js
View
@@ -346,7 +346,6 @@ Zlib.prototype.end = function end(chunk, cb) {
var self = this;
this._ending = true;
var ret = this.write(chunk, function() {
- self.emit('end');
if (cb) cb();
});
this._ended = true;
@@ -440,7 +439,7 @@ Zlib.prototype._process = function() {
self._process();
if (err == binding.Z_STREAM_END) {
- self.emit('close');
+ self.emit('end');
}
}
};
Please sign in to comment.
Something went wrong with that request. Please try again.