summaryrefslogtreecommitdiff
path: root/lib/internal
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-01-21 01:22:27 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2019-02-28 18:31:10 +0100
commit9edce1e12a7b69e7986dd15fce18d6e46590161a (patch)
treec5d37d8016a27bab698520ecc51cda4f7ad99d40 /lib/internal
parent7b674697d8005c29391ebaaf562eb4d92ed9b129 (diff)
downloadandroid-node-v8-9edce1e12a7b69e7986dd15fce18d6e46590161a.tar.gz
android-node-v8-9edce1e12a7b69e7986dd15fce18d6e46590161a.tar.bz2
android-node-v8-9edce1e12a7b69e7986dd15fce18d6e46590161a.zip
benchmark,doc,lib,test: capitalize comments
This updates a lot of comments. PR-URL: https://github.com/nodejs/node/pull/26223 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Diffstat (limited to 'lib/internal')
-rw-r--r--lib/internal/child_process.js8
-rw-r--r--lib/internal/cluster/child.js2
-rw-r--r--lib/internal/console/constructor.js2
-rw-r--r--lib/internal/fs/read_file_context.js2
-rw-r--r--lib/internal/fs/streams.js4
-rw-r--r--lib/internal/http2/core.js6
-rw-r--r--lib/internal/modules/cjs/loader.js4
-rw-r--r--lib/internal/process/per_thread.js2
-rw-r--r--lib/internal/streams/async_iterator.js8
-rw-r--r--lib/internal/streams/legacy.js4
-rw-r--r--lib/internal/timers.js2
-rw-r--r--lib/internal/url.js4
12 files changed, 24 insertions, 24 deletions
diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js
index edbf396cf5..070acd70b7 100644
--- a/lib/internal/child_process.js
+++ b/lib/internal/child_process.js
@@ -99,7 +99,7 @@ const handleConversion = {
// if the socket was created by net.Server
if (socket.server) {
- // the worker should keep track of the socket
+ // The worker should keep track of the socket
message.key = socket.server._connectionKey;
var firstTime = !this.channel.sockets.send[message.key];
@@ -384,15 +384,15 @@ ChildProcess.prototype.spawn = function(options) {
continue;
}
- // stream is already cloned and piped, so close
+ // The stream is already cloned and piped, thus close it.
if (stream.type === 'wrap') {
stream.handle.close();
continue;
}
if (stream.handle) {
- // when i === 0 - we're dealing with stdin
- // (which is the only one writable pipe)
+ // When i === 0 - we're dealing with stdin
+ // (which is the only one writable pipe).
stream.socket = createSocket(this.pid !== 0 ?
stream.handle : null, i > 0);
diff --git a/lib/internal/cluster/child.js b/lib/internal/cluster/child.js
index 38d52948e5..d2f38a6b76 100644
--- a/lib/internal/cluster/child.js
+++ b/lib/internal/cluster/child.js
@@ -47,7 +47,7 @@ cluster._setupWorker = function() {
}
};
-// obj is a net#Server or a dgram#Socket object.
+// `obj` is a net#Server or a dgram#Socket object.
cluster._getServer = function(obj, options, cb) {
let address = options.address;
diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js
index 84339310f0..42c35c14a8 100644
--- a/lib/internal/console/constructor.js
+++ b/lib/internal/console/constructor.js
@@ -358,7 +358,7 @@ Console.prototype.trace = function trace(...args) {
Console.prototype.assert = function assert(expression, ...args) {
if (!expression) {
args[0] = `Assertion failed${args.length === 0 ? '' : `: ${args[0]}`}`;
- this.warn(...args); // the arguments will be formatted in warn() again
+ this.warn(...args); // The arguments will be formatted in warn() again
}
};
diff --git a/lib/internal/fs/read_file_context.js b/lib/internal/fs/read_file_context.js
index d7543ffa5a..4961ee820a 100644
--- a/lib/internal/fs/read_file_context.js
+++ b/lib/internal/fs/read_file_context.js
@@ -23,7 +23,7 @@ function readFileAfterRead(err, bytesRead) {
else
context.read();
} else {
- // unknown size, just read until we don't get bytes.
+ // Unknown size, just read until we don't get bytes.
context.buffers.push(context.buffer.slice(0, bytesRead));
context.read();
}
diff --git a/lib/internal/fs/streams.js b/lib/internal/fs/streams.js
index 7174990ebb..b057ddb9bd 100644
--- a/lib/internal/fs/streams.js
+++ b/lib/internal/fs/streams.js
@@ -153,7 +153,7 @@ ReadStream.prototype._read = function(n) {
else
toRead = Math.min(this.end - this.bytesRead + 1, toRead);
- // already read everything we were supposed to read!
+ // Already read everything we were supposed to read!
// treat as EOF.
if (toRead <= 0)
return this.push(null);
@@ -372,7 +372,7 @@ WriteStream.prototype.close = function(cb) {
this.on('finish', this.destroy.bind(this));
}
- // we use end() instead of destroy() because of
+ // We use end() instead of destroy() because of
// https://github.com/nodejs/node/issues/2006
this.end();
};
diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js
index 0a566ed9e6..dcb1b22d44 100644
--- a/lib/internal/http2/core.js
+++ b/lib/internal/http2/core.js
@@ -1734,7 +1734,7 @@ class Http2Stream extends Duplex {
return !!(this[kState].flags & STREAM_FLAGS_HEADERS_SENT);
}
- // true if the Http2Stream was aborted abnormally.
+ // True if the Http2Stream was aborted abnormally.
get aborted() {
return !!(this[kState].flags & STREAM_FLAGS_ABORTED);
}
@@ -2242,7 +2242,7 @@ class ServerHttp2Stream extends Http2Stream {
this[kAuthority] = headers[HTTP2_HEADER_AUTHORITY];
}
- // true if the remote peer accepts push streams
+ // True if the remote peer accepts push streams
get pushAllowed() {
return !this.destroyed &&
!this.closed &&
@@ -2603,7 +2603,7 @@ function sessionOnError(error) {
// When the session times out on the server, try emitting a timeout event.
// If no handler is registered, destroy the session.
function sessionOnTimeout() {
- // if destroyed or closed already, do nothing
+ // If destroyed or closed already, do nothing
if (this.destroyed || this.closed)
return;
const server = this[kServer];
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index e22294f337..8da55acd9b 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -237,7 +237,7 @@ function tryPackage(requestPath, exts, isMain) {
// Set to an empty Map to reset.
const realpathCache = new Map();
-// check if the file exists and is not a directory
+// Check if the file exists and is not a directory
// if using --preserve-symlinks and isMain is false,
// keep symlinks intact, otherwise resolve to the
// absolute realpath.
@@ -914,7 +914,7 @@ Module._initPaths = function() {
modulePaths = paths;
- // clone as a shallow copy, for introspection.
+ // Clone as a shallow copy, for introspection.
Module.globalPaths = modulePaths.slice(0);
};
diff --git a/lib/internal/process/per_thread.js b/lib/internal/process/per_thread.js
index 28b9afe1cf..fa0334b8bf 100644
--- a/lib/internal/process/per_thread.js
+++ b/lib/internal/process/per_thread.js
@@ -262,7 +262,7 @@ function buildAllowedFlags() {
constructor(...args) {
super(...args);
- // the super constructor consumes `add`, but
+ // The super constructor consumes `add`, but
// disallow any future adds.
this.add = () => this;
}
diff --git a/lib/internal/streams/async_iterator.js b/lib/internal/streams/async_iterator.js
index cc8e218498..810132c0cb 100644
--- a/lib/internal/streams/async_iterator.js
+++ b/lib/internal/streams/async_iterator.js
@@ -31,7 +31,7 @@ function readAndResolve(iter) {
}
function onReadable(iter) {
- // we wait for the next tick, because it might
+ // We wait for the next tick, because it might
// emit an error with process.nextTick
process.nextTick(readAndResolve, iter);
}
@@ -58,7 +58,7 @@ const ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf({
},
next() {
- // if we have detected an error in the meanwhile
+ // If we have detected an error in the meanwhile
// reject straight away
const error = this[kError];
if (error !== null) {
@@ -95,7 +95,7 @@ const ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf({
if (lastPromise) {
promise = new Promise(wrapForNext(lastPromise, this));
} else {
- // fast path needed to support multiple this.push()
+ // Fast path needed to support multiple this.push()
// without triggering the next() queue
const data = this[kStream].read();
if (data !== null) {
@@ -160,7 +160,7 @@ const createReadableStreamAsyncIterator = (stream) => {
finished(stream, (err) => {
if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {
const reject = iterator[kLastReject];
- // reject if we are waiting for data in the Promise
+ // Reject if we are waiting for data in the Promise
// returned by next() and store the error
if (reject !== null) {
iterator[kLastPromise] = null;
diff --git a/lib/internal/streams/legacy.js b/lib/internal/streams/legacy.js
index 85c88c73f0..693987e9d1 100644
--- a/lib/internal/streams/legacy.js
+++ b/lib/internal/streams/legacy.js
@@ -50,7 +50,7 @@ Stream.prototype.pipe = function(dest, options) {
if (typeof dest.destroy === 'function') dest.destroy();
}
- // don't leave dangling pipes when there are errors.
+ // Don't leave dangling pipes when there are errors.
function onerror(er) {
cleanup();
if (EE.listenerCount(this, 'error') === 0) {
@@ -61,7 +61,7 @@ Stream.prototype.pipe = function(dest, options) {
source.on('error', onerror);
dest.on('error', onerror);
- // remove all the event listeners that were added.
+ // Remove all the event listeners that were added.
function cleanup() {
source.removeListener('data', ondata);
dest.removeListener('drain', ondrain);
diff --git a/lib/internal/timers.js b/lib/internal/timers.js
index 6cd8fd72c0..a43819da46 100644
--- a/lib/internal/timers.js
+++ b/lib/internal/timers.js
@@ -62,7 +62,7 @@ function Timeout(callback, after, args, isRepeat) {
'\nTimeout duration was set to 1.',
'TimeoutOverflowWarning');
}
- after = 1; // schedule on next tick, follows browser behavior
+ after = 1; // Schedule on next tick, follows browser behavior
}
this._idleTimeout = after;
diff --git a/lib/internal/url.js b/lib/internal/url.js
index 9727133ad1..08ae050b95 100644
--- a/lib/internal/url.js
+++ b/lib/internal/url.js
@@ -1102,7 +1102,7 @@ defineIDLClass(URLSearchParams.prototype, 'URLSearchParams', {
const key = list[i];
const value = list[i + 1];
callback.call(thisArg, value, key, this);
- // in case the URL object's `search` is updated
+ // In case the URL object's `search` is updated
list = this[searchParams];
i += 2;
}
@@ -1369,7 +1369,7 @@ function pathToFileURL(filepath) {
const outURL = new URL('file://');
if (resolved.includes('%'))
resolved = resolved.replace(percentRegEx, '%25');
- // in posix, "/" is a valid character in paths
+ // In posix, "/" is a valid character in paths
if (!isWindows && resolved.includes('\\'))
resolved = resolved.replace(backslashRegEx, '%5C');
if (resolved.includes('\n'))