summaryrefslogtreecommitdiff
path: root/lib/_stream_readable.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-12-10 13:27:32 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2018-12-17 17:14:35 +0100
commit50dd555910ed0338c35f27ee57e947b9ec95724c (patch)
tree73a0d59eb5b1087afa4c42bc667bb268f1a23b72 /lib/_stream_readable.js
parentbe3ae339360c9833a77ebf5772786d75b7a8dd78 (diff)
downloadandroid-node-v8-50dd555910ed0338c35f27ee57e947b9ec95724c.tar.gz
android-node-v8-50dd555910ed0338c35f27ee57e947b9ec95724c.tar.bz2
android-node-v8-50dd555910ed0338c35f27ee57e947b9ec95724c.zip
doc,lib,test: capitalize comment sentences
This activates the eslint capitalize comment rule for comments above 50 characters. PR-URL: https://github.com/nodejs/node/pull/24996 Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/_stream_readable.js')
-rw-r--r--lib/_stream_readable.js38
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js
index fbab236203..8db8848ba1 100644
--- a/lib/_stream_readable.js
+++ b/lib/_stream_readable.js
@@ -79,7 +79,7 @@ function ReadableState(options, stream, isDuplex) {
if (typeof isDuplex !== 'boolean')
isDuplex = stream instanceof Stream.Duplex;
- // object stream flag. Used to make read(n) ignore n and to
+ // Object stream flag. Used to make read(n) ignore n and to
// make all the buffer merging and length checks go away
this.objectMode = !!options.objectMode;
@@ -109,7 +109,7 @@ function ReadableState(options, stream, isDuplex) {
// not happen before the first read call.
this.sync = true;
- // whenever we return null, then we set a flag to say
+ // Whenever we return null, then we set a flag to say
// that we're awaiting a 'readable' event emission.
this.needReadable = false;
this.emittedReadable = false;
@@ -172,7 +172,7 @@ function Readable(options) {
}
Object.defineProperty(Readable.prototype, 'destroyed', {
- // making it explicit this property is not enumerable
+ // Making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
@@ -323,7 +323,7 @@ Readable.prototype.setEncoding = function(enc) {
if (!StringDecoder)
StringDecoder = require('string_decoder').StringDecoder;
this._readableState.decoder = new StringDecoder(enc);
- // if setEncoding(null), decoder.encoding equals utf8
+ // If setEncoding(null), decoder.encoding equals utf8
this._readableState.encoding = this._readableState.decoder.encoding;
return this;
};
@@ -384,7 +384,7 @@ Readable.prototype.read = function(n) {
if (n !== 0)
state.emittedReadable = false;
- // if we're doing read(0) to trigger a readable event, but we
+ // If we're doing read(0) to trigger a readable event, but we
// already have a bunch of data in the buffer, then just trigger
// the 'readable' event and move on.
if (n === 0 &&
@@ -403,7 +403,7 @@ Readable.prototype.read = function(n) {
n = howMuchToRead(n, state);
- // if we've ended, and we're now clear, then finish it up.
+ // If we've ended, and we're now clear, then finish it up.
if (n === 0 && state.ended) {
if (state.length === 0)
endReadable(this);
@@ -506,12 +506,12 @@ function onEofChunk(stream, state) {
state.ended = true;
if (state.sync) {
- // if we are sync, wait until next tick to emit the data.
+ // If we are sync, wait until next tick to emit the data.
// Otherwise we risk emitting data in the flow()
// the readable code triggers during a read() call
emitReadable(stream);
} else {
- // emit 'readable' now to make sure it gets picked up.
+ // Emit 'readable' now to make sure it gets picked up.
state.needReadable = false;
if (!state.emittedReadable) {
state.emittedReadable = true;
@@ -656,7 +656,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) {
dest.end();
}
- // when the dest drains, it reduces the awaitDrain counter
+ // When the dest drains, it reduces the awaitDrain counter
// on the source. This would be more elegant with a .once()
// handler in flow(), but adding and removing repeatedly is
// too slow.
@@ -678,7 +678,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) {
cleanedUp = true;
- // if the reader is waiting for a drain event from this
+ // If the reader is waiting for a drain event from this
// specific writer, then it would cause it to never start
// flowing again.
// So, if this is awaiting a drain, then we just call it now.
@@ -708,8 +708,8 @@ Readable.prototype.pipe = function(dest, pipeOpts) {
}
}
- // if the dest has an error, then stop piping into it.
- // however, don't suppress the throwing behavior for this.
+ // If the dest has an error, then stop piping into it.
+ // However, don't suppress the throwing behavior for this.
function onerror(er) {
debug('onerror', er);
unpipe();
@@ -828,7 +828,7 @@ Readable.prototype.on = function(ev, fn) {
const state = this._readableState;
if (ev === 'data') {
- // update readableListening so that resume() may be a no-op
+ // Update readableListening so that resume() may be a no-op
// a few lines down. This is needed to support once('readable').
state.readableListening = this.listenerCount('readable') > 0;
@@ -958,7 +958,7 @@ function flow(stream) {
while (state.flowing && stream.read() !== null);
}
-// wrap an old-style stream as the async data source.
+// Wrap an old-style stream as the async data source.
// This is *not* part of the readable stream interface.
// It is an ugly unfortunate mess of history.
Readable.prototype.wrap = function(stream) {
@@ -1011,7 +1011,7 @@ Readable.prototype.wrap = function(stream) {
stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
}
- // when we try to consume some more bytes, simply unpause the
+ // When we try to consume some more bytes, simply unpause the
// underlying stream.
this._read = (n) => {
debug('wrapped _read', n);
@@ -1034,7 +1034,7 @@ Readable.prototype[Symbol.asyncIterator] = function() {
};
Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
- // making it explicit this property is not enumerable
+ // Making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
@@ -1044,7 +1044,7 @@ Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
});
Object.defineProperty(Readable.prototype, 'readableBuffer', {
- // making it explicit this property is not enumerable
+ // Making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
@@ -1054,7 +1054,7 @@ Object.defineProperty(Readable.prototype, 'readableBuffer', {
});
Object.defineProperty(Readable.prototype, 'readableFlowing', {
- // making it explicit this property is not enumerable
+ // Making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
@@ -1072,7 +1072,7 @@ Object.defineProperty(Readable.prototype, 'readableFlowing', {
Readable._fromList = fromList;
Object.defineProperty(Readable.prototype, 'readableLength', {
- // making it explicit this property is not enumerable
+ // Making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,