@@ -347,8 +347,7 @@ Object.defineProperty(Zlib.prototype, 'bytesRead', {
347
347
// `params()` function should not happen while a write is currently in progress
348
348
// on the threadpool.
349
349
function paramsAfterFlushCallback ( level , strategy , callback ) {
350
- if ( ! this . _handle )
351
- assert ( false , 'zlib binding closed' ) ;
350
+ assert ( this . _handle , 'zlib binding closed' ) ;
352
351
this . _handle . params ( level , strategy ) ;
353
352
if ( ! this . _hadError ) {
354
353
this . _level = level ;
@@ -504,8 +503,8 @@ function processChunkSync(self, chunk, flushFlag) {
504
503
else
505
504
buffers . push ( out ) ;
506
505
nread += out . byteLength ;
507
- } else if ( have < 0 ) {
508
- assert ( false , 'have should not go down' ) ;
506
+ } else {
507
+ assert ( have === 0 , 'have should not go down' ) ;
509
508
}
510
509
511
510
// exhausted the output buffer, or used all the input create a new one.
@@ -542,8 +541,7 @@ function processChunkSync(self, chunk, flushFlag) {
542
541
543
542
function processChunk ( self , chunk , flushFlag , cb ) {
544
543
var handle = self . _handle ;
545
- if ( ! handle )
546
- assert ( false , 'zlib binding closed' ) ;
544
+ assert ( handle , 'zlib binding closed' ) ;
547
545
548
546
handle . buffer = chunk ;
549
547
handle . cb = cb ;
@@ -590,8 +588,8 @@ function processCallback() {
590
588
var out = self . _outBuffer . slice ( self . _outOffset , self . _outOffset + have ) ;
591
589
self . _outOffset += have ;
592
590
self . push ( out ) ;
593
- } else if ( have < 0 ) {
594
- assert ( false , 'have should not go down' ) ;
591
+ } else {
592
+ assert ( have === 0 , 'have should not go down' ) ;
595
593
}
596
594
597
595
if ( self . destroyed ) {
0 commit comments