@@ -444,7 +444,7 @@ Readable.prototype.read = function(n) { |
444 | 444 | // 3. Actually pull the requested chunks out of the buffer and return. |
445 | 445 |
|
446 | 446 | // if we need a readable event, then we need to do some reading. |
447 | | - var doRead = state.needReadable; |
| 447 | + let doRead = state.needReadable; |
448 | 448 | debug('need readable', doRead); |
449 | 449 |
|
450 | 450 | // If we currently have less than the highWaterMark, then also read some |
@@ -475,7 +475,7 @@ Readable.prototype.read = function(n) { |
475 | 475 | n = howMuchToRead(nOrig, state); |
476 | 476 | } |
477 | 477 |
|
478 | | - var ret; |
| 478 | + let ret; |
479 | 479 | if (n > 0) |
480 | 480 | ret = fromList(n, state); |
481 | 481 | else |
@@ -514,7 +514,7 @@ function onEofChunk(stream, state) { |
514 | 514 | debug('onEofChunk'); |
515 | 515 | if (state.ended) return; |
516 | 516 | if (state.decoder) { |
517 | | - var chunk = state.decoder.end(); |
| 517 | + const chunk = state.decoder.end(); |
518 | 518 | if (chunk && chunk.length) { |
519 | 519 | state.buffer.push(chunk); |
520 | 520 | state.length += state.objectMode ? 1 : chunk.length; |
@@ -675,7 +675,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) { |
675 | 675 |
|
676 | 676 | let ondrain; |
677 | 677 |
|
678 | | - var cleanedUp = false; |
| 678 | + let cleanedUp = false; |
679 | 679 | function cleanup() { |
680 | 680 | debug('cleanup'); |
681 | 681 | // Cleanup event handlers once the pipe is broken |
@@ -816,7 +816,7 @@ Readable.prototype.unpipe = function(dest) { |
816 | 816 |
|
817 | 817 | if (!dest) { |
818 | 818 | // remove all. |
819 | | - var dests = state.pipes; |
| 819 | + const dests = state.pipes; |
820 | 820 | state.pipes = []; |
821 | 821 | this.pause(); |
822 | 822 |
|
@@ -984,12 +984,12 @@ function flow(stream) { |
984 | 984 | // It is an ugly unfortunate mess of history. |
985 | 985 | Readable.prototype.wrap = function(stream) { |
986 | 986 | const state = this._readableState; |
987 | | - var paused = false; |
| 987 | + let paused = false; |
988 | 988 |
|
989 | 989 | stream.on('end', () => { |
990 | 990 | debug('wrapped end'); |
991 | 991 | if (state.decoder && !state.ended) { |
992 | | - var chunk = state.decoder.end(); |
| 992 | + const chunk = state.decoder.end(); |
993 | 993 | if (chunk && chunk.length) |
994 | 994 | this.push(chunk); |
995 | 995 | } |
@@ -1161,7 +1161,7 @@ function fromList(n, state) { |
1161 | 1161 | if (state.length === 0) |
1162 | 1162 | return null; |
1163 | 1163 |
|
1164 | | - var ret; |
| 1164 | + let ret; |
1165 | 1165 | if (state.objectMode) |
1166 | 1166 | ret = state.buffer.shift(); |
1167 | 1167 | else if (!n || n >= state.length) { |
|