Browse Source

zlib: name every function Ref: #8913

PR-URL: https://github.com/nodejs/node/pull/9389
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
v6
solebox 8 years ago
committed by Michael Dawson
parent
commit
77ec310d0c
  1. 7
      lib/zlib.js

7
lib/zlib.js

@ -346,7 +346,7 @@ function Zlib(opts, mode) {
var self = this;
this._hadError = false;
this._handle.onerror = function(message, errno) {
this._handle.onerror = function onErrorHandler(message, errno) {
// there is no way to cleanly recover.
// continuing only obscures problems.
_close(self);
@ -401,7 +401,7 @@ Zlib.prototype.params = function(level, strategy, callback) {
if (this._level !== level || this._strategy !== strategy) {
var self = this;
this.flush(constants.Z_SYNC_FLUSH, function() {
this.flush(constants.Z_SYNC_FLUSH, function flushCallback() {
assert(self._handle, 'zlib binding closed');
self._handle.params(level, strategy);
if (!self._hadError) {
@ -442,7 +442,8 @@ Zlib.prototype.flush = function(kind, callback) {
this.once('end', callback);
} else if (ws.needDrain) {
if (callback) {
this.once('drain', () => this.flush(kind, callback));
const drainHandler = () => this.flush(kind, callback);
this.once('drain', drainHandler);
}
} else {
this._flushFlag = kind;

Loading…
Cancel
Save