@@ -118,8 +118,8 @@ that implements an HTTP server:
118
118
const http = require (' http' );
119
119
120
120
const server = http .createServer ((req , res ) => {
121
- // req is an http.IncomingMessage, which is a Readable Stream
122
- // res is an http.ServerResponse, which is a Writable Stream
121
+ // ` req` is an http.IncomingMessage, which is a Readable Stream
122
+ // ` res` is an http.ServerResponse, which is a Writable Stream
123
123
124
124
let body = ' ' ;
125
125
// Get the data as utf8 strings.
@@ -1195,7 +1195,7 @@ function parseHeader(stream, callback) {
1195
1195
stream .removeListener (' readable' , onReadable);
1196
1196
if (buf .length )
1197
1197
stream .unshift (buf);
1198
- // now the body of the message can be read from the stream.
1198
+ // Now the body of the message can be read from the stream.
1199
1199
callback (null , header, stream);
1200
1200
} else {
1201
1201
// still reading the header.
@@ -1930,19 +1930,19 @@ pause/resume mechanism, and a data callback, the low-level source can be wrapped
1930
1930
by the custom ` Readable ` instance:
1931
1931
1932
1932
``` js
1933
- // source is an object with readStop() and readStart() methods,
1933
+ // `_source` is an object with readStop() and readStart() methods,
1934
1934
// and an `ondata` member that gets called when it has data, and
1935
1935
// an `onend` member that gets called when the data is over.
1936
1936
1937
1937
class SourceWrapper extends Readable {
1938
1938
constructor (options ) {
1939
1939
super (options);
1940
1940
1941
- this ._source = getLowlevelSourceObject ();
1941
+ this ._source = getLowLevelSourceObject ();
1942
1942
1943
1943
// Every time there's data, push it into the internal buffer.
1944
1944
this ._source .ondata = (chunk ) => {
1945
- // if push() returns false, then stop reading from source
1945
+ // If push() returns false, then stop reading from source
1946
1946
if (! this .push (chunk))
1947
1947
this ._source .readStop ();
1948
1948
};
@@ -2391,7 +2391,7 @@ For example, consider the following code:
2391
2391
// WARNING! BROKEN!
2392
2392
net .createServer ((socket ) => {
2393
2393
2394
- // we add an 'end' listener, but never consume the data
2394
+ // We add an 'end' listener, but never consume the data
2395
2395
socket .on (' end' , () => {
2396
2396
// It will never get here.
2397
2397
socket .end (' The message was received but was not processed.\n ' );
0 commit comments