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>
This commit is contained in:
parent
9314886053
commit
77ec310d0c
@ -346,7 +346,7 @@ function Zlib(opts, mode) {
|
|||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
this._hadError = false;
|
this._hadError = false;
|
||||||
this._handle.onerror = function(message, errno) {
|
this._handle.onerror = function onErrorHandler(message, errno) {
|
||||||
// there is no way to cleanly recover.
|
// there is no way to cleanly recover.
|
||||||
// continuing only obscures problems.
|
// continuing only obscures problems.
|
||||||
_close(self);
|
_close(self);
|
||||||
@ -401,7 +401,7 @@ Zlib.prototype.params = function(level, strategy, callback) {
|
|||||||
|
|
||||||
if (this._level !== level || this._strategy !== strategy) {
|
if (this._level !== level || this._strategy !== strategy) {
|
||||||
var self = this;
|
var self = this;
|
||||||
this.flush(constants.Z_SYNC_FLUSH, function() {
|
this.flush(constants.Z_SYNC_FLUSH, function flushCallback() {
|
||||||
assert(self._handle, 'zlib binding closed');
|
assert(self._handle, 'zlib binding closed');
|
||||||
self._handle.params(level, strategy);
|
self._handle.params(level, strategy);
|
||||||
if (!self._hadError) {
|
if (!self._hadError) {
|
||||||
@ -442,7 +442,8 @@ Zlib.prototype.flush = function(kind, callback) {
|
|||||||
this.once('end', callback);
|
this.once('end', callback);
|
||||||
} else if (ws.needDrain) {
|
} else if (ws.needDrain) {
|
||||||
if (callback) {
|
if (callback) {
|
||||||
this.once('drain', () => this.flush(kind, callback));
|
const drainHandler = () => this.flush(kind, callback);
|
||||||
|
this.once('drain', drainHandler);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this._flushFlag = kind;
|
this._flushFlag = kind;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user