summaryrefslogtreecommitdiff
path: root/lib/zlib.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-03-03 19:05:44 -0800
committerisaacs <i@izs.me>2013-03-05 14:27:15 -0800
commitcd68d86c3283af2f4b3c349c2081c609e3978b9b (patch)
tree1ac21569c2bf81e1d2cdbb5d6a0236bfd89c0833 /lib/zlib.js
parent049903e333f843d7587e7c40845a7d51ea5955f8 (diff)
downloadnode-cd68d86c3283af2f4b3c349c2081c609e3978b9b.tar.gz
stream: Remove output function from _transform
Just use stream.push(outputChunk) instead.
Diffstat (limited to 'lib/zlib.js')
-rw-r--r--lib/zlib.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/zlib.js b/lib/zlib.js
index 409286bc1..d3aa858fb 100644
--- a/lib/zlib.js
+++ b/lib/zlib.js
@@ -308,8 +308,8 @@ Zlib.prototype.reset = function reset() {
return this._binding.reset();
};
-Zlib.prototype._flush = function(output, callback) {
- this._transform(null, output, callback);
+Zlib.prototype._flush = function(callback) {
+ this._transform(null, callback);
};
Zlib.prototype.flush = function(callback) {
@@ -320,12 +320,10 @@ Zlib.prototype.flush = function(callback) {
ws.needDrain = true;
var self = this;
this.once('drain', function() {
- self._flush(ts.output, callback);
+ self._flush(callback);
});
- return;
- }
-
- this._flush(ts.output, callback || function() {});
+ } else
+ this._flush(callback || function() {});
};
Zlib.prototype.close = function(callback) {
@@ -345,7 +343,7 @@ Zlib.prototype.close = function(callback) {
});
};
-Zlib.prototype._transform = function(chunk, output, cb) {
+Zlib.prototype._transform = function(chunk, cb) {
var flushFlag;
var ws = this._writableState;
var ending = ws.ending || ws.ended;
@@ -392,7 +390,7 @@ Zlib.prototype._transform = function(chunk, output, cb) {
var out = self._buffer.slice(self._offset, self._offset + have);
self._offset += have;
// serve some output to the consumer.
- output(out);
+ self.push(out);
}
// exhausted the output buffer, or used all the input create a new one.