Skip to content

Commit

Permalink
zlib: name every function Ref: #8913
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
solebox authored and addaleax committed Nov 22, 2016
1 parent 9491352 commit 841a2c4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/zlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 841a2c4

Please sign in to comment.