@@ -443,7 +443,7 @@ Readable.prototype.read = function(n) {
443443 // 3. Actually pull the requested chunks out of the buffer and return.
444444
445445 // if we need a readable event, then we need to do some reading.
446- var doRead = state . needReadable ;
446+ let doRead = state . needReadable ;
447447 debug ( 'need readable' , doRead ) ;
448448
449449 // If we currently have less than the highWaterMark, then also read some
@@ -474,7 +474,7 @@ Readable.prototype.read = function(n) {
474474 n = howMuchToRead ( nOrig , state ) ;
475475 }
476476
477- var ret ;
477+ let ret ;
478478 if ( n > 0 )
479479 ret = fromList ( n , state ) ;
480480 else
@@ -513,7 +513,7 @@ function onEofChunk(stream, state) {
513513 debug ( 'onEofChunk' ) ;
514514 if ( state . ended ) return ;
515515 if ( state . decoder ) {
516- var chunk = state . decoder . end ( ) ;
516+ const chunk = state . decoder . end ( ) ;
517517 if ( chunk && chunk . length ) {
518518 state . buffer . push ( chunk ) ;
519519 state . length += state . objectMode ? 1 : chunk . length ;
@@ -674,7 +674,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) {
674674
675675 let ondrain ;
676676
677- var cleanedUp = false ;
677+ let cleanedUp = false ;
678678 function cleanup ( ) {
679679 debug ( 'cleanup' ) ;
680680 // Cleanup event handlers once the pipe is broken
@@ -817,7 +817,7 @@ Readable.prototype.unpipe = function(dest) {
817817
818818 if ( ! dest ) {
819819 // remove all.
820- var dests = state . pipes ;
820+ const dests = state . pipes ;
821821 state . pipes = [ ] ;
822822 this . pause ( ) ;
823823
@@ -985,12 +985,12 @@ function flow(stream) {
985985// It is an ugly unfortunate mess of history.
986986Readable . prototype . wrap = function ( stream ) {
987987 const state = this . _readableState ;
988- var paused = false ;
988+ let paused = false ;
989989
990990 stream . on ( 'end' , ( ) => {
991991 debug ( 'wrapped end' ) ;
992992 if ( state . decoder && ! state . ended ) {
993- var chunk = state . decoder . end ( ) ;
993+ const chunk = state . decoder . end ( ) ;
994994 if ( chunk && chunk . length )
995995 this . push ( chunk ) ;
996996 }
@@ -1179,7 +1179,7 @@ function fromList(n, state) {
11791179 if ( state . length === 0 )
11801180 return null ;
11811181
1182- var ret ;
1182+ let ret ;
11831183 if ( state . objectMode )
11841184 ret = state . buffer . shift ( ) ;
11851185 else if ( ! n || n >= state . length ) {
0 commit comments