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