Skip to content

Commit 841a2c4

Browse files
soleboxaddaleax
authored andcommittedNov 22, 2016
zlib: name every function Ref: #8913
PR-URL: #9389 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 9491352 commit 841a2c4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎lib/zlib.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ function Zlib(opts, mode) {
346346

347347
var self = this;
348348
this._hadError = false;
349-
this._handle.onerror = function(message, errno) {
349+
this._handle.onerror = function onErrorHandler(message, errno) {
350350
// there is no way to cleanly recover.
351351
// continuing only obscures problems.
352352
_close(self);
@@ -401,7 +401,7 @@ Zlib.prototype.params = function(level, strategy, callback) {
401401

402402
if (this._level !== level || this._strategy !== strategy) {
403403
var self = this;
404-
this.flush(constants.Z_SYNC_FLUSH, function() {
404+
this.flush(constants.Z_SYNC_FLUSH, function flushCallback() {
405405
assert(self._handle, 'zlib binding closed');
406406
self._handle.params(level, strategy);
407407
if (!self._hadError) {
@@ -442,7 +442,8 @@ Zlib.prototype.flush = function(kind, callback) {
442442
this.once('end', callback);
443443
} else if (ws.needDrain) {
444444
if (callback) {
445-
this.once('drain', () => this.flush(kind, callback));
445+
const drainHandler = () => this.flush(kind, callback);
446+
this.once('drain', drainHandler);
446447
}
447448
} else {
448449
this._flushFlag = kind;

0 commit comments

Comments
 (0)
Please sign in to comment.