@@ -86,7 +86,7 @@ function ReadableState(options, stream, isDuplex) {
86
86
if ( isDuplex )
87
87
this . objectMode = this . objectMode || ! ! options . readableObjectMode ;
88
88
89
- // the point at which it stops calling _read() to fill the buffer
89
+ // The point at which it stops calling _read() to fill the buffer
90
90
// Note: 0 is a valid value, means "don't call _read preemptively ever"
91
91
this . highWaterMark = getHighWaterMark ( this , options , 'readableHighWaterMark' ,
92
92
isDuplex ) ;
@@ -103,7 +103,7 @@ function ReadableState(options, stream, isDuplex) {
103
103
this . endEmitted = false ;
104
104
this . reading = false ;
105
105
106
- // a flag to be able to tell if the event 'readable'/'data' is emitted
106
+ // A flag to be able to tell if the event 'readable'/'data' is emitted
107
107
// immediately, or on a later tick. We set this to true at first, because
108
108
// any actions that shouldn't happen until "later" should generally also
109
109
// not happen before the first read call.
@@ -131,7 +131,7 @@ function ReadableState(options, stream, isDuplex) {
131
131
// Everything else in the universe uses 'utf8', though.
132
132
this . defaultEncoding = options . defaultEncoding || 'utf8' ;
133
133
134
- // the number of writers that are awaiting a drain event in .pipe()s
134
+ // The number of writers that are awaiting a drain event in .pipe()s
135
135
this . awaitDrain = 0 ;
136
136
137
137
// if true, a maybeReadMore has been scheduled
@@ -374,7 +374,7 @@ function howMuchToRead(n, state) {
374
374
return state . length ;
375
375
}
376
376
377
- // you can override either this method, or the async _read(n) below.
377
+ // You can override either this method, or the async _read(n) below.
378
378
Readable . prototype . read = function ( n ) {
379
379
debug ( 'read' , n ) ;
380
380
n = parseInt ( n , 10 ) ;
@@ -436,13 +436,13 @@ Readable.prototype.read = function(n) {
436
436
var doRead = state . needReadable ;
437
437
debug ( 'need readable' , doRead ) ;
438
438
439
- // if we currently have less than the highWaterMark, then also read some
439
+ // If we currently have less than the highWaterMark, then also read some
440
440
if ( state . length === 0 || state . length - n < state . highWaterMark ) {
441
441
doRead = true ;
442
442
debug ( 'length less than watermark' , doRead ) ;
443
443
}
444
444
445
- // however , if we've ended, then there's no point, and if we're already
445
+ // However , if we've ended, then there's no point, and if we're already
446
446
// reading, then it's unnecessary.
447
447
if ( state . ended || state . reading ) {
448
448
doRead = false ;
@@ -451,7 +451,7 @@ Readable.prototype.read = function(n) {
451
451
debug ( 'do read' ) ;
452
452
state . reading = true ;
453
453
state . sync = true ;
454
- // if the length is currently zero, then we *need* a readable event.
454
+ // If the length is currently zero, then we *need* a readable event.
455
455
if ( state . length === 0 )
456
456
state . needReadable = true ;
457
457
// call internal read method
@@ -554,7 +554,7 @@ function emitReadable_(stream) {
554
554
}
555
555
556
556
557
- // at this point, the user has presumably seen the 'readable' event,
557
+ // At this point, the user has presumably seen the 'readable' event,
558
558
// and called read() to consume some data. that may have triggered
559
559
// in turn another _read(n) call, in which case reading = true if
560
560
// it's in progress.
@@ -582,7 +582,7 @@ function maybeReadMore_(stream, state) {
582
582
state . readingMore = false ;
583
583
}
584
584
585
- // abstract method. to be overridden in specific implementation classes.
585
+ // Abstract method. to be overridden in specific implementation classes.
586
586
// call cb(er, data) where data is <= n in length.
587
587
// for virtual (non-string, non-buffer) streams, "length" is somewhat
588
588
// arbitrary, and perhaps not very meaningful.
0 commit comments