diff --git a/benchmark/_cli.js b/benchmark/_cli.js index 45e4c7a2bf05fb..fa2bfb83955e73 100644 --- a/benchmark/_cli.js +++ b/benchmark/_cli.js @@ -65,7 +65,7 @@ function CLI(usage, settings) { // item arguments this.items.push(arg); - // the next value must be an item + // The next value must be an item mode = 'item'; } else { // Bad case, abort diff --git a/benchmark/net/net-c2s-cork.js b/benchmark/net/net-c2s-cork.js index 38a0b17512e139..34c4b50296ec75 100644 --- a/benchmark/net/net-c2s-cork.js +++ b/benchmark/net/net-c2s-cork.js @@ -1,4 +1,4 @@ -// test the speed of .pipe() with sockets +// Test the speed of .pipe() with sockets 'use strict'; const common = require('../common.js'); @@ -78,7 +78,7 @@ Writer.prototype.write = function(chunk, encoding, cb) { return true; }; -// doesn't matter, never emits anything. +// Doesn't matter, never emits anything. Writer.prototype.on = function() {}; Writer.prototype.once = function() {}; Writer.prototype.emit = function() {}; diff --git a/benchmark/net/net-c2s.js b/benchmark/net/net-c2s.js index 2d6ac85f5d25b0..732bda131d6b5a 100644 --- a/benchmark/net/net-c2s.js +++ b/benchmark/net/net-c2s.js @@ -1,4 +1,4 @@ -// test the speed of .pipe() with sockets +// Test the speed of .pipe() with sockets 'use strict'; const common = require('../common.js'); @@ -72,7 +72,7 @@ Writer.prototype.write = function(chunk, encoding, cb) { return true; }; -// doesn't matter, never emits anything. +// Doesn't matter, never emits anything. Writer.prototype.on = function() {}; Writer.prototype.once = function() {}; Writer.prototype.emit = function() {}; diff --git a/benchmark/net/net-pipe.js b/benchmark/net/net-pipe.js index dc0b996dc389c5..12db1e13b836d2 100644 --- a/benchmark/net/net-pipe.js +++ b/benchmark/net/net-pipe.js @@ -1,4 +1,4 @@ -// test the speed of .pipe() with sockets +// Test the speed of .pipe() with sockets 'use strict'; const common = require('../common.js'); @@ -75,7 +75,7 @@ Writer.prototype.write = function(chunk, encoding, cb) { return true; }; -// doesn't matter, never emits anything. +// Doesn't matter, never emits anything. Writer.prototype.on = function() {}; Writer.prototype.once = function() {}; Writer.prototype.emit = function() {}; diff --git a/benchmark/net/net-s2c.js b/benchmark/net/net-s2c.js index bb0a3121b9e9e3..848168cda45d83 100644 --- a/benchmark/net/net-s2c.js +++ b/benchmark/net/net-s2c.js @@ -1,4 +1,4 @@ -// test the speed of .pipe() with sockets +// Test the speed of .pipe() with sockets 'use strict'; const common = require('../common.js'); @@ -73,7 +73,7 @@ Writer.prototype.write = function(chunk, encoding, cb) { return true; }; -// doesn't matter, never emits anything. +// Doesn't matter, never emits anything. Writer.prototype.on = function() {}; Writer.prototype.once = function() {}; Writer.prototype.emit = function() {}; diff --git a/benchmark/net/net-wrap-js-stream-passthrough.js b/benchmark/net/net-wrap-js-stream-passthrough.js index abea4b573d320e..1c597b6ed0a199 100644 --- a/benchmark/net/net-wrap-js-stream-passthrough.js +++ b/benchmark/net/net-wrap-js-stream-passthrough.js @@ -68,7 +68,7 @@ Writer.prototype.write = function(chunk, encoding, cb) { return true; }; -// doesn't matter, never emits anything. +// Doesn't matter, never emits anything. Writer.prototype.on = function() {}; Writer.prototype.once = function() {}; Writer.prototype.emit = function() {}; diff --git a/benchmark/net/tcp-raw-s2c.js b/benchmark/net/tcp-raw-s2c.js index 73f4d292cf5541..cc2f69019fff61 100644 --- a/benchmark/net/tcp-raw-s2c.js +++ b/benchmark/net/tcp-raw-s2c.js @@ -5,9 +5,9 @@ const common = require('../common.js'); const util = require('util'); -// if there are dur=N and len=N args, then +// If there are dur=N and len=N args, then // run the function with those settings. -// if not, then queue up a bunch of child processes. +// If not, then queue up a bunch of child processes. const bench = common.createBenchmark(main, { len: [102400, 1024 * 1024 * 16], type: ['utf', 'asc', 'buf'], diff --git a/benchmark/run.js b/benchmark/run.js index 7af2245ef321c9..2eb1ab1a4b0905 100644 --- a/benchmark/run.js +++ b/benchmark/run.js @@ -50,7 +50,7 @@ if (format === 'csv') { for (const key of Object.keys(data.conf)) { conf += ` ${key}=${JSON.stringify(data.conf[key])}`; } - // delete first space of the configuration + // Delete first space of the configuration conf = conf.slice(1); if (format === 'csv') { // Escape quotes (") for correct csv formatting diff --git a/benchmark/timers/immediate.js b/benchmark/timers/immediate.js index 6a34becb918f48..ba50f961daa6aa 100644 --- a/benchmark/timers/immediate.js +++ b/benchmark/timers/immediate.js @@ -57,7 +57,7 @@ function depth1(N) { } } -// concurrent setImmediate, 0 arguments +// Concurrent setImmediate, 0 arguments function breadth(N) { var n = 0; bench.start(); @@ -71,7 +71,7 @@ function breadth(N) { } } -// concurrent setImmediate, 1 argument +// Concurrent setImmediate, 1 argument function breadth1(N) { var n = 0; bench.start(); @@ -85,7 +85,7 @@ function breadth1(N) { } } -// concurrent setImmediate, 4 arguments +// Concurrent setImmediate, 4 arguments function breadth4(N) { N /= 2; var n = 0; diff --git a/doc/api/cluster.md b/doc/api/cluster.md index 879f4af793e79c..90e64239b3b198 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -237,7 +237,7 @@ if (cluster.isMaster) { res.writeHead(200); res.end('hello world\n'); - // notify master about the request + // Notify master about the request process.send({ cmd: 'notifyRequest' }); }).listen(8000); } diff --git a/doc/api/dgram.md b/doc/api/dgram.md index bb492b56c2728a..2d44074df802ca 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -27,7 +27,7 @@ server.on('listening', () => { }); server.bind(41234); -// server listening 0.0.0.0:41234 +// Prints: server listening 0.0.0.0:41234 ``` ## Class: dgram.Socket @@ -172,7 +172,7 @@ server.on('listening', () => { }); server.bind(41234); -// server listening 0.0.0.0:41234 +// Prints: server listening 0.0.0.0:41234 ``` ### socket.bind(options[, callback]) diff --git a/doc/api/domain.md b/doc/api/domain.md index 0f53e958bd8976..226eb660f4b0bf 100644 --- a/doc/api/domain.md +++ b/doc/api/domain.md @@ -420,7 +420,7 @@ d.on('error', (er) => { }); d.run(() => { process.nextTick(() => { - setTimeout(() => { // simulating some various async stuff + setTimeout(() => { // Simulating some various async stuff fs.open('non-existent file', 'r', (er, fd) => { if (er) throw er; // proceed... diff --git a/doc/api/errors.md b/doc/api/errors.md index a93a33b44eb401..498997408da0ea 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -158,7 +158,7 @@ const fs = require('fs'); try { fs.readFile('/some/file/that/does-not-exist', (err, data) => { - // mistaken assumption: throwing here... + // Mistaken assumption: throwing here... if (err) { throw err; } @@ -217,7 +217,7 @@ a string representing the location in the code at which ```js const myObject = {}; Error.captureStackTrace(myObject); -myObject.stack; // similar to `new Error().stack` +myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with @@ -316,7 +316,7 @@ will not be present in the stack traces: const cheetahify = require('./native-binding.node'); function makeFaster() { - // cheetahify *synchronously* calls speedy. + // `cheetahify()` *synchronously* calls speedy. cheetahify(function speedy() { throw new Error('oh no!'); }); diff --git a/doc/api/fs.md b/doc/api/fs.md index b5fd6702f6fbd4..5df0c5a5bfda2e 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1908,7 +1908,7 @@ console.log(fs.readFileSync('temp.txt', 'utf8')); // get the file descriptor of the file to be truncated const fd = fs.openSync('temp.txt', 'r+'); -// truncate the file to first four bytes +// Truncate the file to first four bytes fs.ftruncate(fd, 4, (err) => { assert.ifError(err); console.log(fs.readFileSync('temp.txt', 'utf8')); @@ -3899,7 +3899,7 @@ async function doTruncate() { await filehandle.truncate(4); } finally { if (filehandle) { - // close the file if it is opened. + // Close the file if it is opened. await filehandle.close(); } } @@ -3926,7 +3926,7 @@ async function doTruncate() { await filehandle.truncate(10); } finally { if (filehandle) { - // close the file if it is opened. + // Close the file if it is opened. await filehandle.close(); } } diff --git a/doc/api/http.md b/doc/api/http.md index dc2383aabd9bcf..7c4f09fd364f1b 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -373,7 +373,7 @@ proxy.on('connect', (req, cltSocket, head) => { // now that proxy is running proxy.listen(1337, '127.0.0.1', () => { - // make a request to a tunneling proxy + // Make a request to a tunneling proxy const options = { port: 1337, host: '127.0.0.1', @@ -387,7 +387,7 @@ proxy.listen(1337, '127.0.0.1', () => { req.on('connect', (res, socket, head) => { console.log('got connected!'); - // make a request over an HTTP tunnel + // Make a request over an HTTP tunnel socket.write('GET / HTTP/1.1\r\n' + 'Host: www.google.com:80\r\n' + 'Connection: close\r\n' + @@ -1307,7 +1307,7 @@ with any headers passed to [`response.writeHead()`][], with the headers passed to [`response.writeHead()`][] given precedence. ```js -// returns content-type = text/plain +// Returns content-type = text/plain const server = http.createServer((req, res) => { res.setHeader('Content-Type', 'text/html'); res.setHeader('X-Foo', 'bar'); @@ -1500,7 +1500,7 @@ desired with potential future retrieval and modification, use [`response.setHeader()`][] instead. ```js -// returns content-type = text/plain +// Returns content-type = text/plain const server = http.createServer((req, res) => { res.setHeader('Content-Type', 'text/html'); res.setHeader('X-Foo', 'bar'); @@ -1912,7 +1912,7 @@ http.get('http://nodejs.org/dist/index.json', (res) => { } if (error) { console.error(error.message); - // consume response data to free up memory + // Consume response data to free up memory res.resume(); return; } diff --git a/doc/api/http2.md b/doc/api/http2.md index ac4385ba110a42..434f603201b844 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -3138,7 +3138,7 @@ with any headers passed to [`response.writeHead()`][], with the headers passed to [`response.writeHead()`][] given precedence. ```js -// returns content-type = text/plain +// Returns content-type = text/plain const server = http2.createServer((req, res) => { res.setHeader('Content-Type', 'text/html'); res.setHeader('X-Foo', 'bar'); @@ -3332,7 +3332,7 @@ with any headers passed to [`response.writeHead()`][], with the headers passed to [`response.writeHead()`][] given precedence. ```js -// returns content-type = text/plain +// Returns content-type = text/plain const server = http2.createServer((req, res) => { res.setHeader('Content-Type', 'text/html'); res.setHeader('X-Foo', 'bar'); diff --git a/doc/api/inspector.md b/doc/api/inspector.md index 0a11f6a1ff12eb..f32f6c3032b9d5 100644 --- a/doc/api/inspector.md +++ b/doc/api/inspector.md @@ -171,7 +171,7 @@ session.post('Profiler.enable', () => { // some time later... session.post('Profiler.stop', (err, { profile }) => { - // write profile to disk, upload, etc. + // Write profile to disk, upload, etc. if (!err) { fs.writeFileSync('./profile.cpuprofile', JSON.stringify(profile)); } diff --git a/doc/api/modules.md b/doc/api/modules.md index 222cf71f35c5ca..5ef61141a6353c 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -921,7 +921,7 @@ added: v10.12.0 const { createRequireFromPath } = require('module'); const requireUtil = createRequireFromPath('../src/utils'); -// require `../src/utils/some-tool` +// Require `../src/utils/some-tool` requireUtil('./some-tool'); ``` diff --git a/doc/api/net.md b/doc/api/net.md index 4cc741f7d4a1fb..eae4e74223a11b 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -132,7 +132,7 @@ const server = net.createServer((socket) => { throw err; }); -// grab an arbitrary unused port. +// Grab an arbitrary unused port. server.listen(() => { console.log('opened server on', server.address()); }); diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md index 687cdae3aa3244..666734cf14cc62 100644 --- a/doc/api/perf_hooks.md +++ b/doc/api/perf_hooks.md @@ -331,7 +331,7 @@ const { } = require('perf_hooks'); const obs = new PerformanceObserver((list, observer) => { - // Called three times synchronously. list contains one item + // Called three times synchronously. `list` contains one item. }); obs.observe({ entryTypes: ['mark'] }); @@ -346,7 +346,7 @@ const { } = require('perf_hooks'); const obs = new PerformanceObserver((list, observer) => { - // called once. list contains three items + // Called once. `list` contains three items. }); obs.observe({ entryTypes: ['mark'], buffered: true }); diff --git a/doc/api/process.md b/doc/api/process.md index 8e2e096bd3723c..b8d34f264d63ec 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1286,7 +1286,7 @@ setTimeout(() => { // [ 1, 552 ] console.log(`Benchmark took ${diff[0] * NS_PER_SEC + diff[1]} nanoseconds`); - // benchmark took 1000000552 nanoseconds + // Benchmark took 1000000552 nanoseconds }, 1000); ``` diff --git a/doc/api/readline.md b/doc/api/readline.md index 56a5254adcc238..4db4b0f899cae6 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -457,7 +457,7 @@ For instance: `[[substr1, substr2, ...], originalsubstring]`. function completer(line) { const completions = '.help .error .exit .quit .q'.split(' '); const hits = completions.filter((c) => c.startsWith(line)); - // show all completions if none found + // Show all completions if none found return [hits.length ? hits : completions, line]; } ``` diff --git a/doc/api/stream.md b/doc/api/stream.md index c9d4b035ddd48c..bff9ee06836ca7 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -256,8 +256,8 @@ function writeOneMillionTimes(writer, data, encoding, callback) { // last time! writer.write(data, encoding, callback); } else { - // see if we should continue, or wait - // don't pass the callback, because we're not done yet. + // See if we should continue, or wait. + // Don't pass the callback, because we're not done yet. ok = writer.write(data, encoding); } } while (i > 0 && ok); @@ -418,7 +418,7 @@ const fs = require('fs'); const file = fs.createWriteStream('example.txt'); file.write('hello, '); file.end('world!'); -// writing more now is not allowed! +// Writing more now is not allowed! ``` ##### writable.setDefaultEncoding(encoding) @@ -819,7 +819,7 @@ cause some amount of data to be read into an internal buffer. ```javascript const readable = getReadableStreamSomehow(); readable.on('readable', function() { - // there is some data to read now + // There is some data to read now let data; while (data = this.read()) { @@ -2431,7 +2431,7 @@ net.createServer((socket) => { socket.end('The message was received but was not processed.\n'); }); - // start the flow of data, discarding it. + // Start the flow of data, discarding it. socket.resume(); }).listen(1337); ``` diff --git a/lib/_http_agent.js b/lib/_http_agent.js index 17f6856bc703ad..8632da45726514 100644 --- a/lib/_http_agent.js +++ b/lib/_http_agent.js @@ -162,7 +162,7 @@ Agent.prototype.addRequest = function addRequest(req, options, port/* legacy */, var sockLen = freeLen + this.sockets[name].length; if (freeLen) { - // we have a free socket, so use that. + // We have a free socket, so use that. var socket = this.freeSockets[name].shift(); // Guard against an uninitialized or user supplied Socket. if (socket._handle && typeof socket._handle.asyncReset === 'function') { @@ -357,7 +357,7 @@ function setRequestSocket(agent, req, socket) { return; } socket.setTimeout(req.timeout); - // reset timeout after response end + // Reset timeout after response end req.once('response', (res) => { res.once('end', () => { if (socket.timeout !== agentTimeout) { diff --git a/lib/_http_common.js b/lib/_http_common.js index 7ecef8b83d412b..a83c82c9d4b292 100644 --- a/lib/_http_common.js +++ b/lib/_http_common.js @@ -147,7 +147,7 @@ function parserOnMessageComplete() { stream.push(null); } - // force to read the next incoming message + // Force to read the next incoming message readStart(parser.socket); } diff --git a/lib/_http_server.js b/lib/_http_server.js index adf2543cfe0bc5..7a2675961806a7 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -594,7 +594,7 @@ function resOnFinish(req, res, socket, state, server) { state.keepAliveTimeoutSet = true; } } else { - // start sending the next message + // Start sending the next message var m = state.outgoing.shift(); if (m) { m.assignSocket(socket); diff --git a/lib/_stream_duplex.js b/lib/_stream_duplex.js index 7551af7f4e7f0f..83aac732e94d82 100644 --- a/lib/_stream_duplex.js +++ b/lib/_stream_duplex.js @@ -124,7 +124,7 @@ Object.defineProperty(Duplex.prototype, 'destroyed', { return this._readableState.destroyed && this._writableState.destroyed; }, set(value) { - // we ignore the value if the stream + // We ignore the value if the stream // has not been initialized yet if (this._readableState === undefined || this._writableState === undefined) { diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index b3a1e1933a743b..4e162b97f77f2b 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -182,7 +182,7 @@ Object.defineProperty(Readable.prototype, 'destroyed', { return this._readableState.destroyed; }, set(value) { - // we ignore the value if the stream + // We ignore the value if the stream // has not been initialized yet if (!this._readableState) { return; @@ -600,7 +600,7 @@ function maybeReadMore_(stream, state) { debug('maybeReadMore read 0'); stream.read(0); if (len === state.length) - // didn't get any data, stop spinning. + // Didn't get any data, stop spinning. break; } state.readingMore = false; @@ -741,7 +741,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) { src.unpipe(dest); } - // tell the dest that it's being piped to + // Tell the dest that it's being piped to dest.emit('pipe', src); // Start the flow if it hasn't been started already. @@ -793,7 +793,7 @@ Readable.prototype.unpipe = function(dest) { return this; } - // slow case. multiple pipe destinations. + // Slow case with multiple pipe destinations. if (!dest) { // remove all. @@ -896,7 +896,7 @@ function updateReadableListening(self) { // the upcoming resume will not flow. state.flowing = true; - // crude way to check if we should resume + // Crude way to check if we should resume } else if (self.listenerCount('data') > 0) { self.resume(); } @@ -1008,7 +1008,7 @@ Readable.prototype.wrap = function(stream) { } } - // proxy certain important events. + // Proxy certain important events. for (var n = 0; n < kProxyEvents.length; n++) { stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); } @@ -1070,7 +1070,7 @@ Object.defineProperty(Readable.prototype, 'readableFlowing', { } }); -// exposed for testing purposes only. +// Exposed for testing purposes only. Readable._fromList = fromList; Object.defineProperty(Readable.prototype, 'readableLength', { @@ -1096,7 +1096,7 @@ function fromList(n, state) { if (state.objectMode) ret = state.buffer.shift(); else if (!n || n >= state.length) { - // read it all, truncate the list + // Read it all, truncate the list if (state.decoder) ret = state.buffer.join(''); else if (state.buffer.length === 1) diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index 4c60bf7d7a1bac..e5b11d06a19b39 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -434,7 +434,7 @@ function onwriteError(stream, state, sync, er, cb) { cb(er); stream._writableState.errorEmitted = true; errorOrDestroy(stream, er); - // this can emit finish, but finish must + // This can emit finish, but finish must // always follow error finishMaybe(stream, state); } @@ -589,7 +589,7 @@ Writable.prototype.end = function(chunk, encoding, cb) { this.uncork(); } - // ignore unnecessary end() calls. + // Ignore unnecessary end() calls. if (!state.ending) endWritable(this, state, cb); @@ -697,7 +697,7 @@ Object.defineProperty(Writable.prototype, 'destroyed', { return this._writableState.destroyed; }, set(value) { - // we ignore the value if the stream + // We ignore the value if the stream // has not been initialized yet if (!this._writableState) { return; diff --git a/lib/dgram.js b/lib/dgram.js index e48c117eed134b..ceda82653085df 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -293,7 +293,7 @@ Socket.prototype.bind = function(port_, address_ /* , callback */) { }); } else { if (!state.handle) - return; // handle has been closed in the mean time + return; // Handle has been closed in the mean time const err = state.handle.bind(ip, port || 0, flags); if (err) { diff --git a/lib/domain.js b/lib/domain.js index 76b27dc058e8c2..24cc4061326ee0 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -286,7 +286,7 @@ Domain.prototype.exit = function() { var index = stack.lastIndexOf(this); if (index === -1) return; - // exit all domains until this one. + // Exit all domains until this one. stack.splice(index); exports.active = stack[stack.length - 1]; @@ -301,7 +301,7 @@ Domain.prototype.add = function(ee) { if (ee.domain === this) return; - // has a domain already - remove it first. + // Has a domain already - remove it first. if (ee.domain) ee.domain.remove(ee); diff --git a/lib/fs.js b/lib/fs.js index e8ba400a4b1de1..e5abc59b591d22 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -368,7 +368,7 @@ function readFileSync(path, options) { } while (bytesRead !== 0 && pos < size); } else { do { - // the kernel lies about many files. + // The kernel lies about many files. // Go ahead and try to read some bytes. buffer = Buffer.allocUnsafe(8192); bytesRead = tryReadSync(fd, isUserFd, buffer, 0, 8192); @@ -1414,7 +1414,7 @@ function realpathSync(p, options) { const knownHard = Object.create(null); const original = p; - // current character position in p + // Current character position in p let pos; // The partial path so far, including a trailing slash if any let current; @@ -1481,7 +1481,7 @@ function realpathSync(p, options) { continue; } - // read the link if it wasn't read before + // Read the link if it wasn't read before // dev/ino always return 0 on windows, so skip the check. let linkTarget = null; let id; @@ -1506,7 +1506,7 @@ function realpathSync(p, options) { if (!isWindows) seenLinks[id] = linkTarget; } - // resolve the link, then start over + // Resolve the link, then start over p = pathModule.resolve(resolvedLink, p.slice(pos)); // Skip over roots @@ -1554,7 +1554,7 @@ function realpath(p, options, callback) { const seenLinks = Object.create(null); const knownHard = Object.create(null); - // current character position in p + // Current character position in p let pos; // The partial path so far, including a trailing slash if any let current; @@ -1580,7 +1580,7 @@ function realpath(p, options, callback) { // Walk down the path, swapping out linked path parts for their real // values function LOOP() { - // stop if scanned past end of path + // Stop if scanned past end of path if (pos >= p.length) { return callback(null, encodeRealpathResult(p, options)); } @@ -1620,9 +1620,9 @@ function realpath(p, options, callback) { return process.nextTick(LOOP); } - // stat & read the link if not read before - // call gotTarget as soon as the link target is known - // dev/ino always return 0 on windows, so skip the check. + // Stat & read the link if not read before. + // Call `gotTarget()` as soon as the link target is known. + // `dev`/`ino` always return 0 on windows, so skip the check. let id; if (!isWindows) { const dev = stats.dev.toString(32); @@ -1649,7 +1649,7 @@ function realpath(p, options, callback) { } function gotResolvedLink(resolvedLink) { - // resolve the link, then start over + // Resolve the link, then start over p = pathModule.resolve(resolvedLink, p.slice(pos)); current = base = splitRoot(p); pos = current.length; diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index 4414b002ae0fea..be90d23f2a3203 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -97,7 +97,7 @@ const handleConversion = { if (!socket._handle) return; - // if the socket was created by net.Server + // If the socket was created by net.Server if (socket.server) { // The worker should keep track of the socket message.key = socket.server._connectionKey; @@ -169,7 +169,7 @@ const handleConversion = { // If the socket was created by net.Server we will track the socket if (message.key) { - // add socket to connections list + // Add socket to connections list var socketList = getSocketList('got', this, message.key); socketList.add({ socket: socket @@ -561,7 +561,7 @@ function setupChannel(target, channel) { } }; - // object where socket lists will live + // Object where socket lists will live channel.sockets = { got: {}, send: {} }; // handlers will go through this @@ -670,7 +670,7 @@ function setupChannel(target, channel) { options = { swallowErrors: options }; } - // package messages with a handle object + // Package messages with a handle object if (handle) { // This message will be handled by an internalMessage event handler message = { diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index fb36a173c3bff5..8a9d4d357204ec 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -393,7 +393,7 @@ function toUnixTimestamp(time, name = 'time') { return time; } if (util.isDate(time)) { - // convert to 123.456 UNIX timestamp + // Convert to 123.456 UNIX timestamp return time.getTime() / 1000; } throw new ERR_INVALID_ARG_TYPE(name, ['Date', 'Time in seconds'], time); diff --git a/lib/internal/fs/watchers.js b/lib/internal/fs/watchers.js index 7bc6f2ac97365a..a785b8ded86d1c 100644 --- a/lib/internal/fs/watchers.js +++ b/lib/internal/fs/watchers.js @@ -118,7 +118,7 @@ function FSWatcher() { if (this._handle !== null) { // We don't use this.close() here to avoid firing the close event. this._handle.close(); - this._handle = null; // make the handle garbage collectable + this._handle = null; // Make the handle garbage collectable } const error = errors.uvException({ errno: status, @@ -185,7 +185,7 @@ FSWatcher.prototype.close = function() { return; } this._handle.close(); - this._handle = null; // make the handle garbage collectable + this._handle = null; // Make the handle garbage collectable process.nextTick(emitCloseNT, this); }; diff --git a/lib/internal/http2/compat.js b/lib/internal/http2/compat.js index 286bc51683e494..cad6efc7337eb1 100644 --- a/lib/internal/http2/compat.js +++ b/lib/internal/http2/compat.js @@ -130,7 +130,7 @@ function onStreamEnd() { } function onStreamError(error) { - // this is purposefully left blank + // This is purposefully left blank // // errors in compatibility mode are // not forwarded to the request diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 21f780c733d931..c17980993a9270 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -1732,7 +1732,7 @@ class Http2Stream extends Duplex { this.emit('timeout'); } - // true if the HEADERS frame has been sent + // True if the HEADERS frame has been sent get headersSent() { return !!(this[kState].flags & STREAM_FLAGS_HEADERS_SENT); } @@ -1742,7 +1742,7 @@ class Http2Stream extends Duplex { return !!(this[kState].flags & STREAM_FLAGS_ABORTED); } - // true if dealing with a HEAD request + // True if dealing with a HEAD request get headRequest() { return !!(this[kState].flags & STREAM_FLAGS_HEAD_REQUEST); } diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index def440da63c41c..f5dff9b5c11803 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -335,7 +335,7 @@ Module._findPath = function(request, paths, isMain) { } if (!filename) { - // try it with each of the extensions + // Try it with each of the extensions if (exts === undefined) exts = Object.keys(Module._extensions); filename = tryExtensions(basePath, exts, isMain); @@ -378,7 +378,7 @@ var nmLen = nmChars.length; if (isWindows) { // 'from' is the __dirname of the module. Module._nodeModulePaths = function(from) { - // guarantee that 'from' is absolute. + // Guarantee that 'from' is absolute. from = path.resolve(from); // note: this approach *only* works when the path is guaranteed @@ -422,7 +422,7 @@ if (isWindows) { } else { // posix // 'from' is the __dirname of the module. Module._nodeModulePaths = function(from) { - // guarantee that 'from' is absolute. + // Guarantee that 'from' is absolute. from = path.resolve(from); // Return early not only to avoid unnecessary work, but to *avoid* returning // an array of two items for a root: [ '//node_modules', '/node_modules' ] @@ -836,7 +836,7 @@ Module._extensions['.node'] = function(module, filename) { const moduleURL = pathToFileURL(filename); manifest.assertIntegrity(moduleURL, content); } - // be aware this doesn't use `content` + // Be aware this doesn't use `content` return process.dlopen(module, path.toNamespacedPath(filename)); }; diff --git a/lib/internal/readline.js b/lib/internal/readline.js index f1716f1f25824f..b05c2d575a31dc 100644 --- a/lib/internal/readline.js +++ b/lib/internal/readline.js @@ -244,7 +244,7 @@ function* emitKeys(stream) { */ const cmdStart = s.length - 1; - // skip one or two leading digits + // Skip one or two leading digits if (ch >= '0' && ch <= '9') { s += (ch = yield); @@ -386,7 +386,7 @@ function* emitKeys(stream) { // carriage return key.name = 'return'; } else if (ch === '\n') { - // enter, should have been called linefeed + // Enter, should have been called linefeed key.name = 'enter'; } else if (ch === '\t') { // tab diff --git a/lib/internal/stream_base_commons.js b/lib/internal/stream_base_commons.js index 31291e751d57a6..9c3b60e584c033 100644 --- a/lib/internal/stream_base_commons.js +++ b/lib/internal/stream_base_commons.js @@ -162,7 +162,7 @@ function onStreamRead(arrayBuffer) { return stream.destroy(errnoException(nread, 'read')); } - // defer this until we actually emit end + // Defer this until we actually emit end if (stream._readableState.endEmitted) { if (stream[kMaybeDestroy]) stream[kMaybeDestroy](); @@ -170,7 +170,7 @@ function onStreamRead(arrayBuffer) { if (stream[kMaybeDestroy]) stream.on('end', stream[kMaybeDestroy]); - // push a null to signal the end of data. + // Push a null to signal the end of data. // Do it before `maybeDestroy` for correct order of events: // `end` -> `close` stream.push(null); diff --git a/lib/internal/streams/async_iterator.js b/lib/internal/streams/async_iterator.js index 810132c0cb2c86..0d22e4efeec99c 100644 --- a/lib/internal/streams/async_iterator.js +++ b/lib/internal/streams/async_iterator.js @@ -85,10 +85,9 @@ const ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf({ }); } - // if we have multiple next() calls - // we will wait for the previous Promise to finish - // this logic is optimized to support for await loops, - // where next() is only called once at a time + // If we have multiple next() calls we will wait for the previous Promise to + // finish. This logic is optimized to support for await loops, where next() + // is only called once at a time. const lastPromise = this[kLastPromise]; let promise; @@ -96,7 +95,7 @@ const ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf({ promise = new Promise(wrapForNext(lastPromise, this)); } else { // Fast path needed to support multiple this.push() - // without triggering the next() queue + // without triggering the next() queue. const data = this[kStream].read(); if (data !== null) { return Promise.resolve(createIterResult(data, false)); @@ -136,7 +135,7 @@ const createReadableStreamAsyncIterator = (stream) => { value: stream._readableState.endEmitted, writable: true }, - // the function passed to new Promise + // The function passed to new Promise // is cached so we avoid allocating a new // closure at every run [kHandlePromise]: { diff --git a/lib/net.js b/lib/net.js index e46dea49282c73..2af6fedfd39d6d 100644 --- a/lib/net.js +++ b/lib/net.js @@ -535,7 +535,7 @@ Socket.prototype._read = function(n) { debug('_read wait for connection'); this.once('connect', () => this._read(n)); } else if (!this._handle.reading) { - // not already reading, start the flow + // Not already reading, start the flow debug('Socket._read readStart'); this._handle.reading = true; var err = this._handle.readStart(); @@ -1049,7 +1049,7 @@ Socket.prototype.unref = function() { function afterConnect(status, handle, req, readable, writable) { var self = handle[owner_symbol]; - // callback may come after call to destroy + // Callback may come after call to destroy if (self.destroyed) { return; } diff --git a/lib/readline.js b/lib/readline.js index 46fc3047709915..585128fe02697c 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -768,7 +768,7 @@ Interface.prototype._moveCursor = function(dx) { var newPos = this._getCursorPos(); - // check if cursors are in the same line + // Check if cursors are in the same line if (oldPos.rows === newPos.rows) { var diffCursor = this.cursor - oldcursor; var diffWidth; @@ -837,11 +837,11 @@ Interface.prototype._ttyWrite = function(s, key) { } break; - case 'u': // delete from current to start of line + case 'u': // Delete from current to start of line this._deleteLineLeft(); break; - case 'k': // delete from current to end of line + case 'k': // Delete from current to end of line this._deleteLineRight(); break; @@ -901,12 +901,12 @@ Interface.prototype._ttyWrite = function(s, key) { } break; - case 'w': // delete backwards to a word boundary + case 'w': // Delete backwards to a word boundary case 'backspace': this._deleteWordLeft(); break; - case 'delete': // delete forward to a word boundary + case 'delete': // Delete forward to a word boundary this._deleteWordRight(); break; @@ -936,7 +936,7 @@ Interface.prototype._ttyWrite = function(s, key) { this._deleteWordRight(); break; - case 'backspace': // delete backwards to a word boundary + case 'backspace': // Delete backwards to a word boundary this._deleteWordLeft(); break; } @@ -972,7 +972,7 @@ Interface.prototype._ttyWrite = function(s, key) { break; case 'left': - // obtain the code point to the left + // Obtain the code point to the left this._moveCursor(-charLengthLeft(this.line, this.cursor)); break; diff --git a/lib/sys.js b/lib/sys.js index 87f40fc6d5f1f0..1292a38e9ced07 100644 --- a/lib/sys.js +++ b/lib/sys.js @@ -21,9 +21,8 @@ 'use strict'; -// the sys module was renamed to 'util'. -// this shim remains to keep old programs working. -// sys is deprecated and shouldn't be used +// The sys module was renamed to 'util'. This shim remains to keep old programs +// working. `sys` is deprecated and shouldn't be used. module.exports = require('util'); process.emitWarning('sys is deprecated. Use util instead.', diff --git a/lib/url.js b/lib/url.js index 78dcbe713010e9..391d6c2723d99d 100644 --- a/lib/url.js +++ b/lib/url.js @@ -80,12 +80,12 @@ const unsafeProtocol = new SafeSet([ 'javascript', 'javascript:' ]); -// protocols that never have a hostname. +// Protocols that never have a hostname. const hostlessProtocol = new SafeSet([ 'javascript', 'javascript:' ]); -// protocols that always contain a // bit. +// Protocols that always contain a // bit. const slashedProtocol = new SafeSet([ 'http', 'http:', @@ -367,7 +367,7 @@ Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) { if (this.hostname.length > hostnameMaxLen) { this.hostname = ''; } else { - // hostnames are always lower case. + // Hostnames are always lower case. this.hostname = this.hostname.toLowerCase(); } @@ -396,8 +396,8 @@ Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) { } } - // now rest is set to the post-host stuff. - // chop off any delim chars. + // Now rest is set to the post-host stuff. + // Chop off any delim chars. if (!unsafeProtocol.has(lowerProto)) { // First, make 100% sure that any "autoEscape" chars get // escaped, even if encodeURIComponent doesn't think they @@ -810,7 +810,7 @@ Url.prototype.resolveObject = function resolveObject(relative) { result.search = relative.search; result.query = relative.query; srcPath = relPath; - // fall through to the dot-handling below. + // Fall through to the dot-handling below. } else if (relPath.length) { // it's relative // throw away the existing file, and take the new path instead. diff --git a/lib/zlib.js b/lib/zlib.js index 3bc82e36a82d1d..09c3419b4d0b7c 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -61,7 +61,7 @@ const { BROTLI_OPERATION_FINISH } = constants; -// translation table for return codes. +// Translation table for return codes. const codes = { Z_OK: constants.Z_OK, Z_STREAM_END: constants.Z_STREAM_END, @@ -153,8 +153,8 @@ function zlibBufferSync(engine, buffer) { function zlibOnError(message, errno, code) { var self = this[owner_symbol]; - // there is no way to cleanly recover. - // continuing only obscures problems. + // There is no way to cleanly recover. + // Continuing only obscures problems. _close(self); self._hadError = true; diff --git a/test/async-hooks/test-graph.signal.js b/test/async-hooks/test-graph.signal.js index 4c5b857fc2e08f..c2f889e7b02569 100644 --- a/test/async-hooks/test-graph.signal.js +++ b/test/async-hooks/test-graph.signal.js @@ -23,10 +23,10 @@ function onsigusr2() { count++; if (count === 1) { - // trigger same signal handler again + // Trigger same signal handler again exec(`kill -USR2 ${process.pid}`); } else { - // install another signal handler + // Install another signal handler process.removeAllListeners('SIGUSR2'); process.on('SIGUSR2', common.mustCall(onsigusr2Again)); diff --git a/test/async-hooks/test-promise.promise-before-init-hooks.js b/test/async-hooks/test-promise.promise-before-init-hooks.js index 0f74c968e6a25e..51787b8065a71b 100644 --- a/test/async-hooks/test-promise.promise-before-init-hooks.js +++ b/test/async-hooks/test-promise.promise-before-init-hooks.js @@ -9,7 +9,7 @@ const p = new Promise(common.mustCall(function executor(resolve) { resolve(5); })); -// init hooks after promise was created +// Init hooks after promise was created const hooks = initHooks({ allowNoInit: true }); hooks.enable(); diff --git a/test/async-hooks/test-signalwrap.js b/test/async-hooks/test-signalwrap.js index 5bc02e6dc46204..b906355af707cc 100644 --- a/test/async-hooks/test-signalwrap.js +++ b/test/async-hooks/test-signalwrap.js @@ -42,7 +42,7 @@ function onsigusr2() { signal1, { init: 1, before: 1 }, ' signal1: when first SIGUSR2 handler is called for the first time'); - // trigger same signal handler again + // Trigger same signal handler again exec(`kill -USR2 ${process.pid}`); } else { // second invocation @@ -50,7 +50,7 @@ function onsigusr2() { signal1, { init: 1, before: 2, after: 1 }, 'signal1: when first SIGUSR2 handler is called for the second time'); - // install another signal handler + // Install another signal handler process.removeAllListeners('SIGUSR2'); process.on('SIGUSR2', common.mustCall(onsigusr2Again)); diff --git a/test/async-hooks/test-tcpwrap.js b/test/async-hooks/test-tcpwrap.js index a01a1fc4fe21d4..3256a1598b0adc 100644 --- a/test/async-hooks/test-tcpwrap.js +++ b/test/async-hooks/test-tcpwrap.js @@ -79,7 +79,7 @@ function ontcpConnection(serverConnection) { return; } - // only focusing on TCPCONNECTWRAP here + // Only focusing on TCPCONNECTWRAP here const tcpconnects = hooks.activitiesOfTypes('TCPCONNECTWRAP'); assert.strictEqual(tcpconnects.length, 1); tcpconnect = tcpconnects[0]; diff --git a/test/common/index.js b/test/common/index.js index 732d43f07aaeca..8076c287de7a99 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -821,7 +821,7 @@ module.exports = { const opensslCmd = spawnSync(opensslCli, ['version']); if (opensslCmd.status !== 0 || opensslCmd.error !== undefined) { - // openssl command cannot be executed + // OpenSSL command cannot be executed opensslCli = false; } return opensslCli; diff --git a/test/es-module/test-esm-preserve-symlinks-main.js b/test/es-module/test-esm-preserve-symlinks-main.js index 808b6c9a15f6fd..38ef5d8fcce6ad 100644 --- a/test/es-module/test-esm-preserve-symlinks-main.js +++ b/test/es-module/test-esm-preserve-symlinks-main.js @@ -50,7 +50,7 @@ function doTest(flags, done) { }); } -// first test the commonjs module loader +// First test the commonjs module loader doTest([], () => { // now test the new loader doTest(['--experimental-modules'], () => {}); diff --git a/test/internet/test-dgram-broadcast-multi-process.js b/test/internet/test-dgram-broadcast-multi-process.js index a989d687b0bdf4..a2b687bddb2347 100644 --- a/test/internet/test-dgram-broadcast-multi-process.js +++ b/test/internet/test-dgram-broadcast-multi-process.js @@ -167,7 +167,7 @@ if (process.argv[2] !== 'child') { reuseAddr: true }); - // bind the address explicitly for sending + // Bind the address explicitly for sending // INADDR_BROADCAST to only one interface sendSocket.bind(common.PORT, bindAddress); sendSocket.on('listening', function() { diff --git a/test/js-native-api/test_function/test.js b/test/js-native-api/test_function/test.js index 6f0f1681752a2c..e89d64f61d172a 100644 --- a/test/js-native-api/test_function/test.js +++ b/test/js-native-api/test_function/test.js @@ -4,7 +4,7 @@ const common = require('../../common'); const assert = require('assert'); -// testing api calls for function +// Testing api calls for function const test_function = require(`./build/${common.buildType}/test_function`); function func1() { diff --git a/test/js-native-api/test_general/test.js b/test/js-native-api/test_general/test.js index 720918f9645d99..f0be79085b6658 100644 --- a/test/js-native-api/test_general/test.js +++ b/test/js-native-api/test_general/test.js @@ -32,8 +32,7 @@ assert.strictEqual(test_general.testGetPrototype(extendedObject), assert.notStrictEqual(test_general.testGetPrototype(baseObject), test_general.testGetPrototype(extendedObject)); -// test version management functions -// expected version is currently 4 +// Test version management functions. The expected version is currently 4. assert.strictEqual(test_general.testGetVersion(), 4); [ @@ -91,7 +90,7 @@ assert.strictEqual(finalizeWasCalled, false, ' test_general.finalizeWasCalled() ' + `returned ${finalizeWasCalled}`); -// test napi_adjust_external_memory +// Test napi_adjust_external_memory const adjustedValue = test_general.testAdjustExternalMemory(); assert.strictEqual(typeof adjustedValue, 'number'); assert(adjustedValue > 0); diff --git a/test/js-native-api/test_handle_scope/test.js b/test/js-native-api/test_handle_scope/test.js index 53abfe178c8d7d..3935e1164092f2 100644 --- a/test/js-native-api/test_handle_scope/test.js +++ b/test/js-native-api/test_handle_scope/test.js @@ -2,7 +2,7 @@ const common = require('../../common'); const assert = require('assert'); -// testing handle scope api calls +// Testing handle scope api calls const testHandleScope = require(`./build/${common.buildType}/test_handle_scope`); diff --git a/test/js-native-api/test_properties/test.js b/test/js-native-api/test_properties/test.js index 13a546c7b87f81..fa4cb587d6435a 100644 --- a/test/js-native-api/test_properties/test.js +++ b/test/js-native-api/test_properties/test.js @@ -33,7 +33,7 @@ assert.ok(!propertyNames.includes('readwriteAccessor2')); assert.ok(!propertyNames.includes('readonlyAccessor1')); assert.ok(!propertyNames.includes('readonlyAccessor2')); -// validate property created with symbol +// Validate property created with symbol const start = 'Symbol('.length; const end = start + 'NameKeySymbol'.length; const symbolDescription = diff --git a/test/known_issues/test-dgram-bind-shared-ports-after-port-0.js b/test/known_issues/test-dgram-bind-shared-ports-after-port-0.js index 703dd243760bb1..5ceac4ebeeb5ec 100644 --- a/test/known_issues/test-dgram-bind-shared-ports-after-port-0.js +++ b/test/known_issues/test-dgram-bind-shared-ports-after-port-0.js @@ -29,7 +29,7 @@ if (cluster.isMaster) { const worker2 = cluster.fork({ PRT1: msg.port1 }); worker2.on('message', () => process.exit(0)); worker2.on('exit', (code, signal) => { - // this is the droid we are looking for + // This is the droid we are looking for assert.strictEqual(code, 0); assert.strictEqual(signal, null); }); diff --git a/test/known_issues/test-inspector-cluster-port-clash.js b/test/known_issues/test-inspector-cluster-port-clash.js index 0c5580530995a5..f5baedf8aa670b 100644 --- a/test/known_issues/test-inspector-cluster-port-clash.js +++ b/test/known_issues/test-inspector-cluster-port-clash.js @@ -29,7 +29,7 @@ function serialFork() { return new Promise((res) => { const worker = cluster.fork(); worker.on('error', (err) => assert.fail(err)); - // No common.mustCall since 1 out of 3 should fail + // No common.mustCall since 1 out of 3 should fail. worker.on('online', () => { worker.on('message', common.mustCall((message) => { ports.push(message.debugPort); @@ -50,10 +50,10 @@ function serialFork() { if (cluster.isMaster) { cluster.on('online', common.mustCall((worker) => worker.send('dbgport'), 2)); - // Block one of the ports with a listening socket + // Block one of the ports with a listening socket. const server = net.createServer(); server.listen(clashPort, common.localhostIPv4, common.mustCall(() => { - // try to fork 3 workers No.2 should fail + // Try to fork 3 workers. No.2 should fail. Promise.all([serialFork(), serialFork(), serialFork()]) .then(common.mustNotCall()) .catch((err) => console.error(err)); diff --git a/test/message/throw_in_line_with_tabs.js b/test/message/throw_in_line_with_tabs.js index fdc36b331ab8a1..ab059916b2c8da 100644 --- a/test/message/throw_in_line_with_tabs.js +++ b/test/message/throw_in_line_with_tabs.js @@ -26,7 +26,7 @@ require('../common'); console.error('before'); (function() { - // these lines should contain tab! + // These lines should contain tab! // eslint-disable-next-line no-throw-literal throw ({ foo: 'bar' }); })(); diff --git a/test/message/v8_warning.js b/test/message/v8_warning.js index e3394cdd7094e8..d7d1c5e7dbdff6 100644 --- a/test/message/v8_warning.js +++ b/test/message/v8_warning.js @@ -9,7 +9,7 @@ function AsmModule() { a = a | 0; b = b | 0; - // should be `return (a + b) | 0;` + // Should be `return (a + b) | 0;` return a + b; } diff --git a/test/parallel/test-assert-deep.js b/test/parallel/test-assert-deep.js index bd04bef701c23b..f9ac8d9a1f44ec 100644 --- a/test/parallel/test-assert-deep.js +++ b/test/parallel/test-assert-deep.js @@ -507,7 +507,7 @@ assertNotDeepOrStrict( m2.set(2, 'hi'); // different order m2.set(1, obj); - m2.set(3, [1, 2, 3]); // deep equal, but not reference equal. + m2.set(3, [1, 2, 3]); // Deep equal, but not reference equal. assertDeepAndStrictEqual(m1, m2); } diff --git a/test/parallel/test-async-wrap-tlssocket-asyncreset.js b/test/parallel/test-async-wrap-tlssocket-asyncreset.js index 983bce3b0239f2..e0dd8be2904429 100644 --- a/test/parallel/test-async-wrap-tlssocket-asyncreset.js +++ b/test/parallel/test-async-wrap-tlssocket-asyncreset.js @@ -52,7 +52,7 @@ server.listen( assert.strictEqual(res.statusCode, 200); res2.on('error', (err) => assert.fail(err)); res2.socket.on('error', (err) => assert.fail(err)); - // this should be the end of the test + // This should be the end of the test res2.destroy(); server.close(); }) diff --git a/test/parallel/test-buffer-alloc.js b/test/parallel/test-buffer-alloc.js index 18f55837ab4b4d..3af09aee4c63fc 100644 --- a/test/parallel/test-buffer-alloc.js +++ b/test/parallel/test-buffer-alloc.js @@ -54,10 +54,10 @@ assert.strictEqual(d.length, 0); // Test invalid encoding for Buffer.toString assert.throws(() => b.toString('invalid'), /Unknown encoding: invalid/); -// invalid encoding for Buffer.write +// Invalid encoding for Buffer.write assert.throws(() => b.write('test string', 0, 5, 'invalid'), /Unknown encoding: invalid/); -// unsupported arguments for Buffer.write +// Unsupported arguments for Buffer.write assert.throws(() => b.write('test', 'utf8', 0), /is no longer supported/); @@ -87,13 +87,13 @@ const outOfRangeError = { // Try to write a 0-length string beyond the end of b common.expectsError(() => b.write('', 2048), outOfBoundsError); -// throw when writing to negative offset +// Throw when writing to negative offset common.expectsError(() => b.write('a', -1), outOfBoundsError); // Throw when writing past bounds from the pool common.expectsError(() => b.write('a', 2048), outOfBoundsError); -// throw when writing to negative offset +// Throw when writing to negative offset common.expectsError(() => b.write('a', -1), outOfBoundsError); // Try to copy 0 bytes worth of data into an empty buffer @@ -192,7 +192,7 @@ Buffer.alloc(1).write('', 1, 0); } { - // also from a non-pooled instance + // Also from a non-pooled instance const b = Buffer.allocUnsafeSlow(5); const c = b.slice(0, 4); const d = c.slice(0, 2); @@ -390,7 +390,7 @@ assert.strictEqual(Buffer.from('KioqKioqKioqKioqKioqKioqKio=', 'base64').toString(), '*'.repeat(20)); -// no padding, not a multiple of 4 +// No padding, not a multiple of 4 assert.strictEqual(Buffer.from('Kg', 'base64').toString(), '*'); assert.strictEqual(Buffer.from('Kio', 'base64').toString(), '*'.repeat(2)); assert.strictEqual(Buffer.from('KioqKg', 'base64').toString(), '*'.repeat(4)); @@ -713,7 +713,7 @@ assert.strictEqual(x.inspect(), ''); } { - // test offset returns are correct + // Test offset returns are correct const b = Buffer.allocUnsafe(16); assert.strictEqual(b.writeUInt32LE(0, 0), 4); assert.strictEqual(b.writeUInt16LE(0, 4), 6); @@ -819,7 +819,7 @@ common.expectsError( outOfRangeError ); -// test for common write(U)IntLE/BE +// Test for common write(U)IntLE/BE { let buf = Buffer.allocUnsafe(3); buf.writeUIntLE(0x123456, 0, 3); diff --git a/test/parallel/test-buffer-bytelength.js b/test/parallel/test-buffer-bytelength.js index 3d419b316521e0..c0c7228d0d0b45 100644 --- a/test/parallel/test-buffer-bytelength.js +++ b/test/parallel/test-buffer-bytelength.js @@ -65,7 +65,7 @@ assert.strictEqual(Buffer.byteLength(float64), 64); const dv = new DataView(new ArrayBuffer(2)); assert.strictEqual(Buffer.byteLength(dv), 2); -// special case: zero length string +// Special case: zero length string assert.strictEqual(Buffer.byteLength('', 'ascii'), 0); assert.strictEqual(Buffer.byteLength('', 'HeX'), 0); diff --git a/test/parallel/test-buffer-copy.js b/test/parallel/test-buffer-copy.js index ec227a93741ec2..b35609743764b3 100644 --- a/test/parallel/test-buffer-copy.js +++ b/test/parallel/test-buffer-copy.js @@ -70,7 +70,7 @@ let cntr = 0; } { - // copy starting near end of b to c + // Copy starting near end of b to c b.fill(++cntr); c.fill(++cntr); const copied = b.copy(c, 0, b.length - Math.floor(c.length / 2)); @@ -113,7 +113,7 @@ bb.fill('hello crazy world'); // Try to copy from before the beginning of b. Should not throw. b.copy(c, 0, 100, 10); -// copy throws at negative sourceStart +// Copy throws at negative sourceStart common.expectsError( () => Buffer.allocUnsafe(5).copy(Buffer.allocUnsafe(5), 0, -1), errorProperty); diff --git a/test/parallel/test-buffer-indexof.js b/test/parallel/test-buffer-indexof.js index 0f7d7824366215..cba6af44e5b02d 100644 --- a/test/parallel/test-buffer-indexof.js +++ b/test/parallel/test-buffer-indexof.js @@ -78,7 +78,7 @@ assert.strictEqual(b.indexOf(Buffer.from('f'), 6), -1); assert.strictEqual(Buffer.from('ff').indexOf(Buffer.from('f'), 1, 'ucs2'), -1); -// test invalid and uppercase encoding +// Test invalid and uppercase encoding assert.strictEqual(b.indexOf('b', 'utf8'), 1); assert.strictEqual(b.indexOf('b', 'UTF8'), 1); assert.strictEqual(b.indexOf('62', 'HEX'), 1); diff --git a/test/parallel/test-buffer-iterator.js b/test/parallel/test-buffer-iterator.js index 3120ff1d2ab457..72b775c71313d7 100644 --- a/test/parallel/test-buffer-iterator.js +++ b/test/parallel/test-buffer-iterator.js @@ -16,7 +16,7 @@ for (b of buffer) assert.deepStrictEqual(arr, [1, 2, 3, 4, 5]); -// buffer iterators should be iterable +// Buffer iterators should be iterable arr = []; diff --git a/test/parallel/test-buffer-read.js b/test/parallel/test-buffer-read.js index 1adf0303566380..7b3b9eb8e2b1a7 100644 --- a/test/parallel/test-buffer-read.js +++ b/test/parallel/test-buffer-read.js @@ -2,7 +2,7 @@ const common = require('../common'); const assert = require('assert'); -// testing basic buffer read functions +// Testing basic buffer read functions const buf = Buffer.from([0xa4, 0xfd, 0x48, 0xea, 0xcf, 0xff, 0xd9, 0x01, 0xde]); function read(buff, funx, args, expected) { diff --git a/test/parallel/test-buffer-slow.js b/test/parallel/test-buffer-slow.js index cb10a414771372..ade6ba16ffd83d 100644 --- a/test/parallel/test-buffer-slow.js +++ b/test/parallel/test-buffer-slow.js @@ -49,7 +49,7 @@ assert.strictEqual(SlowBuffer(NaN).length, 0); assert.strictEqual(SlowBuffer({}).length, 0); assert.strictEqual(SlowBuffer('string').length, 0); -// should throw with invalid length +// Should throw with invalid length const bufferMaxSizeMsg = common.expectsError({ code: 'ERR_INVALID_OPT_VALUE', type: RangeError, diff --git a/test/parallel/test-child-process-constructor.js b/test/parallel/test-child-process-constructor.js index bf7fffd9c5456f..f0bebd61efc057 100644 --- a/test/parallel/test-child-process-constructor.js +++ b/test/parallel/test-child-process-constructor.js @@ -85,7 +85,7 @@ child.spawn({ assert.strictEqual(child.hasOwnProperty('pid'), true); assert(Number.isInteger(child.pid)); -// try killing with invalid signal +// Try killing with invalid signal common.expectsError( () => { child.kill('foo'); }, { code: 'ERR_UNKNOWN_SIGNAL', type: TypeError } diff --git a/test/parallel/test-child-process-disconnect.js b/test/parallel/test-child-process-disconnect.js index 8ca39b5790e243..7ba30b28db3d3e 100644 --- a/test/parallel/test-child-process-disconnect.js +++ b/test/parallel/test-child-process-disconnect.js @@ -57,7 +57,7 @@ if (process.argv[2] === 'child') { socket.write('ready'); }); - // when the server is ready tell parent + // When the server is ready tell parent server.on('listening', function() { process.send({ msg: 'ready', port: server.address().port }); }); diff --git a/test/parallel/test-child-process-double-pipe.js b/test/parallel/test-child-process-double-pipe.js index 8503ebf69cc89d..bf640fd3798345 100644 --- a/test/parallel/test-child-process-double-pipe.js +++ b/test/parallel/test-child-process-double-pipe.js @@ -65,7 +65,7 @@ grep.stdin.on('drain', function(data) { echo.stdout.resume(); }); -// propagate end from echo to grep +// Propagate end from echo to grep echo.stdout.on('end', function(code) { grep.stdin.end(); }); @@ -95,7 +95,7 @@ sed.stdin.on('drain', function(data) { grep.stdout.resume(); }); -// propagate end from grep to sed +// Propagate end from grep to sed grep.stdout.on('end', function(code) { console.error('grep stdout end'); sed.stdin.end(); diff --git a/test/parallel/test-child-process-fork-ref.js b/test/parallel/test-child-process-fork-ref.js index 3eae2b242e9ce2..bbf4432af80866 100644 --- a/test/parallel/test-child-process-fork-ref.js +++ b/test/parallel/test-child-process-fork-ref.js @@ -27,7 +27,7 @@ const fork = require('child_process').fork; if (process.argv[2] === 'child') { process.send('1'); - // check that child don't instantly die + // Check that child don't instantly die setTimeout(function() { process.send('2'); }, 200); diff --git a/test/parallel/test-child-process-stdio-big-write-end.js b/test/parallel/test-child-process-stdio-big-write-end.js index 00fc0471d235aa..07656c04ca936d 100644 --- a/test/parallel/test-child-process-stdio-big-write-end.js +++ b/test/parallel/test-child-process-stdio-big-write-end.js @@ -56,14 +56,14 @@ function parent() { sent += bufsize; } while (child.stdin.write(buf)); - // then write a bunch more times. + // Then write a bunch more times. for (let i = 0; i < 100; i++) { const buf = Buffer.alloc(bufsize, '.'); sent += bufsize; child.stdin.write(buf); } - // now end, before it's all flushed. + // Now end, before it's all flushed. child.stdin.end(); // now we wait... diff --git a/test/parallel/test-child-process-stdio-inherit.js b/test/parallel/test-child-process-stdio-inherit.js index b77391d87dca2c..dfffb70c582016 100644 --- a/test/parallel/test-child-process-stdio-inherit.js +++ b/test/parallel/test-child-process-stdio-inherit.js @@ -45,7 +45,7 @@ function grandparent() { child.on('close', function(code, signal) { assert.strictEqual(code, 0); assert.strictEqual(signal, null); - // cat on windows adds a \r\n at the end. + // 'cat' on windows adds a \r\n at the end. assert.strictEqual(output.trim(), input.trim()); }); } diff --git a/test/parallel/test-child-process-validate-stdio.js b/test/parallel/test-child-process-validate-stdio.js index 71edc0559755b2..3566c8f9520f30 100644 --- a/test/parallel/test-child-process-validate-stdio.js +++ b/test/parallel/test-child-process-validate-stdio.js @@ -11,7 +11,7 @@ const expectedError = // Should throw if string and not ignore, pipe, or inherit assert.throws(() => _validateStdio('foo'), expectedError); -// should throw if not a string or array +// Should throw if not a string or array assert.throws(() => _validateStdio(600), expectedError); // Should populate stdio with undefined if len < 3 diff --git a/test/parallel/test-cli-syntax-piped-bad.js b/test/parallel/test-cli-syntax-piped-bad.js index 864497e8f75c94..4fb24b24f339c7 100644 --- a/test/parallel/test-cli-syntax-piped-bad.js +++ b/test/parallel/test-cli-syntax-piped-bad.js @@ -25,7 +25,7 @@ syntaxArgs.forEach(function(args) { // stderr should include '[stdin]' as the filename assert(c.stderr.startsWith('[stdin]'), `${c.stderr} starts with ${stdin}`); - // no stdout or stderr should be produced + // No stdout or stderr should be produced assert.strictEqual(c.stdout, ''); // stderr should have a syntax error message diff --git a/test/parallel/test-cli-syntax-piped-good.js b/test/parallel/test-cli-syntax-piped-good.js index b3467b037212ab..cdadf449d87b41 100644 --- a/test/parallel/test-cli-syntax-piped-good.js +++ b/test/parallel/test-cli-syntax-piped-good.js @@ -18,7 +18,7 @@ syntaxArgs.forEach(function(args) { const stdin = 'throw new Error("should not get run");'; const c = spawnSync(node, args, { encoding: 'utf8', input: stdin }); - // no stdout or stderr should be produced + // No stdout or stderr should be produced assert.strictEqual(c.stdout, ''); assert.strictEqual(c.stderr, ''); diff --git a/test/parallel/test-cluster-disconnect.js b/test/parallel/test-cluster-disconnect.js index 36def06a4c3dd2..51cbb43c63f5a4 100644 --- a/test/parallel/test-cluster-disconnect.js +++ b/test/parallel/test-cluster-disconnect.js @@ -92,7 +92,7 @@ if (cluster.isWorker) { testCluster(common.mustCall(() => { // 3. disconnect cluster cluster.disconnect(common.mustCall(() => { - // run test again to confirm cleanup + // Run test again to confirm cleanup if (again) { test(); } diff --git a/test/parallel/test-cluster-eaccess.js b/test/parallel/test-cluster-eaccess.js index 7a3bc1c5cd1311..4c2d28429307dc 100644 --- a/test/parallel/test-cluster-eaccess.js +++ b/test/parallel/test-cluster-eaccess.js @@ -41,7 +41,7 @@ if (cluster.isMaster && process.argv.length !== 3) { // Makes sure master is able to fork the worker cluster.on('fork', common.mustCall()); - // makes sure the worker is ready + // Makes sure the worker is ready worker.on('online', common.mustCall()); worker.on('message', common.mustCall(function(err) { @@ -71,7 +71,7 @@ if (cluster.isMaster && process.argv.length !== 3) { }); })); } else if (process.argv.length === 3) { - // child process (of cluster.worker) + // Child process (of cluster.worker) const PIPE_NAME = process.argv[2]; const server = net.createServer().listen(PIPE_NAME, common.mustCall(() => { diff --git a/test/parallel/test-cluster-listening-port.js b/test/parallel/test-cluster-listening-port.js index 84bf49fa96c81f..40d66065d947ce 100644 --- a/test/parallel/test-cluster-listening-port.js +++ b/test/parallel/test-cluster-listening-port.js @@ -8,9 +8,9 @@ if (cluster.isMaster) { cluster.fork(); cluster.on('listening', common.mustCall(function(worker, address) { const port = address.port; - // ensure that the port is not 0 or null + // Ensure that the port is not 0 or null assert(port); - // ensure that the port is numerical + // Ensure that the port is numerical assert.strictEqual(typeof port, 'number'); worker.kill(); })); diff --git a/test/parallel/test-cluster-net-listen.js b/test/parallel/test-cluster-net-listen.js index f6b2c4e45a6eb9..ff102797eab8f9 100644 --- a/test/parallel/test-cluster-net-listen.js +++ b/test/parallel/test-cluster-net-listen.js @@ -26,7 +26,7 @@ const cluster = require('cluster'); const net = require('net'); if (cluster.isMaster) { - // ensure that the worker exits peacefully + // Ensure that the worker exits peacefully cluster.fork().on('exit', common.mustCall(function(statusCode) { assert.strictEqual(statusCode, 0); })); diff --git a/test/parallel/test-common.js b/test/parallel/test-common.js index a133204437facb..62f4eb050fb5d5 100644 --- a/test/parallel/test-common.js +++ b/test/parallel/test-common.js @@ -26,7 +26,7 @@ const fixtures = require('../common/fixtures'); const assert = require('assert'); const { execFile } = require('child_process'); -// test for leaked global detection +// Test for leaked global detection { const p = fixtures.path('leakedGlobal.js'); execFile(process.execPath, [p], common.mustCall((err, stdout, stderr) => { diff --git a/test/parallel/test-console.js b/test/parallel/test-console.js index 4a7a2fda683ef6..87ee8ad1ff1230 100644 --- a/test/parallel/test-console.js +++ b/test/parallel/test-console.js @@ -93,35 +93,35 @@ hijackStderr(function(data) { errStrings.push(data); }); -// test console.log() goes to stdout +// Test console.log() goes to stdout console.log('foo'); console.log('foo', 'bar'); console.log('%s %s', 'foo', 'bar', 'hop'); console.log({ slashes: '\\\\' }); console.log(custom_inspect); -// test console.debug() goes to stdout +// Test console.debug() goes to stdout console.debug('foo'); console.debug('foo', 'bar'); console.debug('%s %s', 'foo', 'bar', 'hop'); console.debug({ slashes: '\\\\' }); console.debug(custom_inspect); -// test console.info() goes to stdout +// Test console.info() goes to stdout console.info('foo'); console.info('foo', 'bar'); console.info('%s %s', 'foo', 'bar', 'hop'); console.info({ slashes: '\\\\' }); console.info(custom_inspect); -// test console.error() goes to stderr +// Test console.error() goes to stderr console.error('foo'); console.error('foo', 'bar'); console.error('%s %s', 'foo', 'bar', 'hop'); console.error({ slashes: '\\\\' }); console.error(custom_inspect); -// test console.warn() goes to stderr +// Test console.warn() goes to stderr console.warn('foo'); console.warn('foo', 'bar'); console.warn('%s %s', 'foo', 'bar', 'hop'); diff --git a/test/parallel/test-crypto-binary-default.js b/test/parallel/test-crypto-binary-default.js index bb0247bf5817b5..80be4dea11e63b 100644 --- a/test/parallel/test-crypto-binary-default.js +++ b/test/parallel/test-crypto-binary-default.js @@ -480,8 +480,8 @@ function testCipher1(key) { function testCipher2(key) { - // encryption and decryption with Base64 - // reported in https://github.com/joyent/node/issues/738 + // Encryption and decryption with Base64. + // Reported in https://github.com/joyent/node/issues/738 const plaintext = '32|RmVZZkFUVmpRRkp0TmJaUm56ZU9qcnJkaXNNWVNpTTU*|iXmckfRWZBGWWELw' + 'eCBsThSsfUHLeRe0KCsK8ooHgxie0zOINpXxfZi/oNG7uq9JWFVCk70gfzQH8ZUJ' + diff --git a/test/parallel/test-crypto-cipher-decipher.js b/test/parallel/test-crypto-cipher-decipher.js index 9f79abc70545dd..e7ab8f73b02b0b 100644 --- a/test/parallel/test-crypto-cipher-decipher.js +++ b/test/parallel/test-crypto-cipher-decipher.js @@ -53,16 +53,16 @@ function testCipher1(key) { function testCipher2(key) { - // encryption and decryption with Base64 - // reported in https://github.com/joyent/node/issues/738 + // Encryption and decryption with Base64. + // Reported in https://github.com/joyent/node/issues/738 const plaintext = '32|RmVZZkFUVmpRRkp0TmJaUm56ZU9qcnJkaXNNWVNpTTU*|iXmckfRWZBGWWELw' + 'eCBsThSsfUHLeRe0KCsK8ooHgxie0zOINpXxfZi/oNG7uq9JWFVCk70gfzQH8ZUJ' + 'jAfaFg**'; const cipher = crypto.createCipher('aes256', key); - // Encrypt plaintext which is in utf8 format - // to a ciphertext which will be in Base64 + // Encrypt plaintext which is in utf8 format to a ciphertext which will be in + // Base64. let ciph = cipher.update(plaintext, 'utf8', 'base64'); ciph += cipher.final('base64'); diff --git a/test/parallel/test-crypto-from-binary.js b/test/parallel/test-crypto-from-binary.js index 56d0cb72079f82..3b3c6a81ef6a4a 100644 --- a/test/parallel/test-crypto-from-binary.js +++ b/test/parallel/test-crypto-from-binary.js @@ -36,7 +36,7 @@ const EXTERN_APEX = 0xFBEE9; // Manually controlled string for checking binary output let ucs2_control = 'a\u0000'; -// grow the strings to proper length +// Grow the strings to proper length while (ucs2_control.length <= EXTERN_APEX) { ucs2_control = ucs2_control.repeat(2); } diff --git a/test/parallel/test-crypto-keygen.js b/test/parallel/test-crypto-keygen.js index 7b3eee570ddf40..43f2196115816e 100644 --- a/test/parallel/test-crypto-keygen.js +++ b/test/parallel/test-crypto-keygen.js @@ -635,7 +635,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); message: 'Unknown cipher' }); - // cipher, but no valid passphrase. + // Cipher, but no valid passphrase. for (const passphrase of [undefined, null, 5, false, true]) { common.expectsError(() => generateKeyPairSync('rsa', { modulusLength: 4096, diff --git a/test/parallel/test-domain-multi.js b/test/parallel/test-domain-multi.js index 45d94b35a17c4c..63701150f8c331 100644 --- a/test/parallel/test-domain-multi.js +++ b/test/parallel/test-domain-multi.js @@ -27,7 +27,7 @@ const domain = require('domain'); const http = require('http'); const a = domain.create(); -a.enter(); // this will be our "root" domain +a.enter(); // This will be our "root" domain a.on('error', common.mustNotCall()); @@ -62,11 +62,11 @@ const server = http.createServer((req, res) => { const c = domain.create(); const req = http.get({ host: 'localhost', port: server.address().port }); - // add the request to the C domain + // Add the request to the C domain c.add(req); req.on('response', (res) => { - // add the response object to the C domain + // Add the response object to the C domain c.add(res); res.pipe(process.stdout); }); diff --git a/test/parallel/test-event-emitter-add-listeners.js b/test/parallel/test-event-emitter-add-listeners.js index 6ef39522183d4f..7812de670ff5fb 100644 --- a/test/parallel/test-event-emitter-add-listeners.js +++ b/test/parallel/test-event-emitter-add-listeners.js @@ -60,7 +60,7 @@ const EventEmitter = require('events'); ee.emit('hello', 'a', 'b'); } -// just make sure that this doesn't throw: +// Just make sure that this doesn't throw: { const f = new EventEmitter(); diff --git a/test/parallel/test-file-write-stream2.js b/test/parallel/test-file-write-stream2.js index e29bd80ebf792c..5e18ad44ae7dfa 100644 --- a/test/parallel/test-file-write-stream2.js +++ b/test/parallel/test-file-write-stream2.js @@ -62,7 +62,7 @@ function removeTestFile() { tmpdir.refresh(); -// drain at 0, return false at 10. +// Drain at 0, return false at 10. const file = fs.createWriteStream(filepath, { highWaterMark: 11 }); diff --git a/test/parallel/test-fs-append-file-sync.js b/test/parallel/test-fs-append-file-sync.js index e053d061610b11..190381234aa5ad 100644 --- a/test/parallel/test-fs-append-file-sync.js +++ b/test/parallel/test-fs-append-file-sync.js @@ -39,7 +39,7 @@ const data = '南越国是前203年至前111年存在于岭南地区的一个国 const tmpdir = require('../common/tmpdir'); tmpdir.refresh(); -// Test that empty file will be created and have content added +// Test that empty file will be created and have content added. const filename = join(tmpdir.path, 'append-sync.txt'); fs.appendFileSync(filename, data); @@ -48,7 +48,7 @@ const fileData = fs.readFileSync(filename); assert.strictEqual(Buffer.byteLength(data), fileData.length); -// Test that appends data to a non empty file +// Test that appends data to a non empty file. const filename2 = join(tmpdir.path, 'append-sync2.txt'); fs.writeFileSync(filename2, currentFileData); @@ -59,7 +59,7 @@ const fileData2 = fs.readFileSync(filename2); assert.strictEqual(Buffer.byteLength(data) + currentFileData.length, fileData2.length); -// Test that appendFileSync accepts buffers +// Test that appendFileSync accepts buffers. const filename3 = join(tmpdir.path, 'append-sync3.txt'); fs.writeFileSync(filename3, currentFileData); @@ -70,13 +70,13 @@ const fileData3 = fs.readFileSync(filename3); assert.strictEqual(buf.length + currentFileData.length, fileData3.length); -// test that appendFile accepts numbers. +// Test that appendFile accepts numbers. const filename4 = join(tmpdir.path, 'append-sync4.txt'); fs.writeFileSync(filename4, currentFileData, { mode: m }); fs.appendFileSync(filename4, num, { mode: m }); -// windows permissions aren't unix +// Windows permissions aren't Unix. if (!common.isWindows) { const st = fs.statSync(filename4); assert.strictEqual(st.mode & 0o700, m); @@ -87,7 +87,7 @@ const fileData4 = fs.readFileSync(filename4); assert.strictEqual(Buffer.byteLength(String(num)) + currentFileData.length, fileData4.length); -// Test that appendFile accepts file descriptors +// Test that appendFile accepts file descriptors. const filename5 = join(tmpdir.path, 'append-sync5.txt'); fs.writeFileSync(filename5, currentFileData); @@ -100,7 +100,7 @@ const fileData5 = fs.readFileSync(filename5); assert.strictEqual(Buffer.byteLength(data) + currentFileData.length, fileData5.length); -// Exit logic for cleanup +// Exit logic for cleanup. process.on('exit', function() { fs.unlinkSync(filename); diff --git a/test/parallel/test-fs-append-file.js b/test/parallel/test-fs-append-file.js index 3122982e2a4af4..90fe8d9277a23e 100644 --- a/test/parallel/test-fs-append-file.js +++ b/test/parallel/test-fs-append-file.js @@ -42,7 +42,7 @@ tmpdir.refresh(); const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; -// Test that empty file will be created and have content added (callback API) +// Test that empty file will be created and have content added (callback API). { const filename = join(tmpdir.path, 'append.txt'); @@ -56,7 +56,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; })); } -// Test that empty file will be created and have content added (promise API) +// Test that empty file will be created and have content added (promise API). { const filename = join(tmpdir.path, 'append-promise.txt'); @@ -68,7 +68,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; .catch(throwNextTick); } -// Test that appends data to a non-empty file (callback API) +// Test that appends data to a non-empty file (callback API). { const filename = join(tmpdir.path, 'append-non-empty.txt'); fs.writeFileSync(filename, currentFileData); @@ -84,7 +84,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; })); } -// Test that appends data to a non-empty file (promise API) +// Test that appends data to a non-empty file (promise API). { const filename = join(tmpdir.path, 'append-non-empty-promise.txt'); fs.writeFileSync(filename, currentFileData); @@ -98,7 +98,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; .catch(throwNextTick); } -// Test that appendFile accepts buffers (callback API) +// Test that appendFile accepts buffers (callback API). { const filename = join(tmpdir.path, 'append-buffer.txt'); fs.writeFileSync(filename, currentFileData); @@ -115,7 +115,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; })); } -// Test that appendFile accepts buffers (promises API) +// Test that appendFile accepts buffers (promises API). { const filename = join(tmpdir.path, 'append-buffer-promises.txt'); fs.writeFileSync(filename, currentFileData); @@ -130,7 +130,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; .catch(throwNextTick); } -// Test that appendFile accepts numbers (callback API) +// Test that appendFile accepts numbers (callback API). { const filename = join(tmpdir.path, 'append-numbers.txt'); fs.writeFileSync(filename, currentFileData); @@ -139,7 +139,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; fs.appendFile(filename, n, { mode: m }, common.mustCall((e) => { assert.ifError(e); - // windows permissions aren't unix + // Windows permissions aren't Unix. if (!common.isWindows) { const st = fs.statSync(filename); assert.strictEqual(st.mode & 0o700, m); @@ -153,7 +153,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; })); } -// Test that appendFile accepts numbers (promises API) +// Test that appendFile accepts numbers (promises API). { const filename = join(tmpdir.path, 'append-numbers-promises.txt'); fs.writeFileSync(filename, currentFileData); @@ -161,7 +161,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; const m = 0o600; fs.promises.appendFile(filename, n, { mode: m }) .then(common.mustCall(() => { - // windows permissions aren't unix + // Windows permissions aren't Unix. if (!common.isWindows) { const st = fs.statSync(filename); assert.strictEqual(st.mode & 0o700, m); @@ -176,7 +176,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; .catch(throwNextTick); } -// Test that appendFile accepts file descriptors (callback API) +// Test that appendFile accepts file descriptors (callback API). { const filename = join(tmpdir.path, 'append-descriptors.txt'); fs.writeFileSync(filename, currentFileData); @@ -200,7 +200,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; })); } -// Test that appendFile accepts file descriptors (promises API) +// Test that appendFile accepts file descriptors (promises API). { const filename = join(tmpdir.path, 'append-descriptors-promises.txt'); fs.writeFileSync(filename, currentFileData); diff --git a/test/parallel/test-fs-error-messages.js b/test/parallel/test-fs-error-messages.js index dd5438c44bfce9..370b4f46977a20 100644 --- a/test/parallel/test-fs-error-messages.js +++ b/test/parallel/test-fs-error-messages.js @@ -321,7 +321,7 @@ function re(literals, ...values) { `ENOTEMPTY: directory not empty, rename '${existingDir}' -> ` + `'${existingDir2}'`); assert.strictEqual(err.errno, UV_ENOTEMPTY); - } else if (err.code === 'EXDEV') { // not on the same mounted filesystem + } else if (err.code === 'EXDEV') { // Not on the same mounted filesystem assert.strictEqual( err.message, `EXDEV: cross-device link not permitted, rename '${existingDir}' -> ` + diff --git a/test/parallel/test-fs-link.js b/test/parallel/test-fs-link.js index 9b95fc3e026140..f4f3f787d7fd51 100644 --- a/test/parallel/test-fs-link.js +++ b/test/parallel/test-fs-link.js @@ -7,7 +7,7 @@ const fs = require('fs'); const tmpdir = require('../common/tmpdir'); tmpdir.refresh(); -// test creating and reading hard link +// Test creating and reading hard link const srcPath = path.join(tmpdir.path, 'hardlink-target.txt'); const dstPath = path.join(tmpdir.path, 'link1.js'); fs.writeFileSync(srcPath, 'hello world'); diff --git a/test/parallel/test-fs-mkdir.js b/test/parallel/test-fs-mkdir.js index f2ed9b9f68ed92..2a15627a0f1767 100644 --- a/test/parallel/test-fs-mkdir.js +++ b/test/parallel/test-fs-mkdir.js @@ -132,7 +132,7 @@ function nextdir() { } } -// mkdirp when folder does not yet exist. +// `mkdirp` when folder does not yet exist. { const pathname = path.join(tmpdir.path, nextdir(), nextdir()); diff --git a/test/parallel/test-fs-open.js b/test/parallel/test-fs-open.js index 788124825249ca..9a1ae623fea302 100644 --- a/test/parallel/test-fs-open.js +++ b/test/parallel/test-fs-open.js @@ -27,7 +27,7 @@ const fs = require('fs'); let caughtException = false; try { - // should throw ENOENT, not EBADF + // Should throw ENOENT, not EBADF // see https://github.com/joyent/node/pull/1228 fs.openSync('/path/to/file/that/does/not/exist', 'r'); } catch (e) { diff --git a/test/parallel/test-fs-promises-file-handle-chmod.js b/test/parallel/test-fs-promises-file-handle-chmod.js index cb7a1c6317be41..2a05218969ee0a 100644 --- a/test/parallel/test-fs-promises-file-handle-chmod.js +++ b/test/parallel/test-fs-promises-file-handle-chmod.js @@ -17,7 +17,7 @@ tmpdir.refresh(); async function validateFilePermission() { const filePath = path.resolve(tmpDir, 'tmp-chmod.txt'); const fileHandle = await open(filePath, 'w+', 0o444); - // file created with r--r--r-- 444 + // File created with r--r--r-- 444 const statsBeforeMod = fs.statSync(filePath); assert.deepStrictEqual(statsBeforeMod.mode & 0o444, 0o444); @@ -34,7 +34,7 @@ async function validateFilePermission() { expectedAccess = newPermissions; } - // change the permissions to rwxr--r-x + // Change the permissions to rwxr--r-x await fileHandle.chmod(newPermissions); const statsAfterMod = fs.statSync(filePath); assert.deepStrictEqual(statsAfterMod.mode & expectedAccess, expectedAccess); diff --git a/test/parallel/test-fs-promises.js b/test/parallel/test-fs-promises.js index 749e0a6f087107..97b5f8326e6052 100644 --- a/test/parallel/test-fs-promises.js +++ b/test/parallel/test-fs-promises.js @@ -119,7 +119,7 @@ async function getHandle(dest) { await unlink(dest); } - // bytes written to file match buffer + // Bytes written to file match buffer { const handle = await getHandle(dest); const buf = Buffer.from('hello fsPromises'); @@ -130,7 +130,7 @@ async function getHandle(dest) { assert.deepStrictEqual(ret.buffer, buf); } - // truncate file to specified length + // Truncate file to specified length { const handle = await getHandle(dest); const buf = Buffer.from('hello FileHandle'); @@ -224,7 +224,7 @@ async function getHandle(dest) { const newMode = 0o666; if (common.isOSX) { - // lchmod is only available on macOS + // `lchmod` is only available on macOS. await lchmod(newLink, newMode); stats = await lstat(newLink); assert.strictEqual(stats.mode & 0o777, newMode); @@ -287,7 +287,7 @@ async function getHandle(dest) { assert(stats.isDirectory()); } - // mkdirp when folder does not yet exist. + // `mkdirp` when folder does not yet exist. { const dir = path.join(tmpDir, nextdir(), nextdir()); await mkdir(dir, { recursive: true }); @@ -344,7 +344,7 @@ async function getHandle(dest) { }); } - // mkdtemp with invalid numeric prefix + // `mkdtemp` with invalid numeric prefix { await mkdtemp(path.resolve(tmpDir, 'FOO')); assert.rejects( diff --git a/test/parallel/test-fs-read-stream-err.js b/test/parallel/test-fs-read-stream-err.js index a9b4838cf1834f..1d280f64874fc7 100644 --- a/test/parallel/test-fs-read-stream-err.js +++ b/test/parallel/test-fs-read-stream-err.js @@ -43,15 +43,15 @@ fs.close = common.mustCall((fd_, cb) => { const read = fs.read; fs.read = function() { - // first time is ok. + // First time is ok. read.apply(fs, arguments); - // then it breaks + // Then it breaks. fs.read = common.mustCall(function() { const cb = arguments[arguments.length - 1]; process.nextTick(() => { cb(err); }); - // and should not be called again! + // It should not be called again! fs.read = () => { throw new Error('BOOM!'); }; diff --git a/test/parallel/test-fs-read-stream-inherit.js b/test/parallel/test-fs-read-stream-inherit.js index a081302cc5a0f1..69f3b9c3f724bd 100644 --- a/test/parallel/test-fs-read-stream-inherit.js +++ b/test/parallel/test-fs-read-stream-inherit.js @@ -140,7 +140,7 @@ const rangeFile = fixtures.path('x.txt'); })); } -// pause and then resume immediately. +// Pause and then resume immediately. { const pauseRes = fs.createReadStream(rangeFile); pauseRes.pause(); diff --git a/test/parallel/test-fs-read-stream.js b/test/parallel/test-fs-read-stream.js index 2a07a09c976574..b1559ed9ea8c04 100644 --- a/test/parallel/test-fs-read-stream.js +++ b/test/parallel/test-fs-read-stream.js @@ -206,7 +206,7 @@ if (!common.isWindows) { } { - // pause and then resume immediately. + // Pause and then resume immediately. const pauseRes = fs.createReadStream(rangeFile); pauseRes.pause(); pauseRes.resume(); diff --git a/test/parallel/test-fs-realpath.js b/test/parallel/test-fs-realpath.js index 1eaf1681d75fba..48294d4a62e0ec 100644 --- a/test/parallel/test-fs-realpath.js +++ b/test/parallel/test-fs-realpath.js @@ -365,7 +365,7 @@ function test_upone_actual(realpath, realpathSync, cb) { cb(); } -// going up with .. multiple times +// Going up with .. multiple times // . // `-- a/ // |-- b/ @@ -407,7 +407,7 @@ function test_up_multiple(realpath, realpathSync, cb) { } -// absolute symlinks with children. +// Absolute symlinks with children. // . // `-- a/ // |-- b/ diff --git a/test/parallel/test-fs-symlink-dir-junction.js b/test/parallel/test-fs-symlink-dir-junction.js index 5bd7a8dcc4ecc3..fc89ad368401e4 100644 --- a/test/parallel/test-fs-symlink-dir-junction.js +++ b/test/parallel/test-fs-symlink-dir-junction.js @@ -28,7 +28,7 @@ const fs = require('fs'); const tmpdir = require('../common/tmpdir'); -// test creating and reading symbolic link +// Test creating and reading symbolic link const linkData = fixtures.path('cycles/'); const linkPath = path.join(tmpdir.path, 'cycles_link'); diff --git a/test/parallel/test-fs-utimes.js b/test/parallel/test-fs-utimes.js index 93932e27d7e777..e34953423bd11f 100644 --- a/test/parallel/test-fs-utimes.js +++ b/test/parallel/test-fs-utimes.js @@ -33,7 +33,7 @@ function stat_resource(resource) { return fs.statSync(resource); } else { const stats = fs.fstatSync(resource); - // ensure mtime has been written to disk + // Ensure mtime has been written to disk // except for directories on AIX where it cannot be synced if (common.isAIX && stats.isDirectory()) return stats; @@ -59,8 +59,8 @@ function expect_errno(syscall, resource, err, errno) { function expect_ok(syscall, resource, err, atime, mtime) { const mtime_diff = check_mtime(resource, mtime); assert( - // check up to single-second precision - // sub-second precision is OS and fs dependant + // Check up to single-second precision. + // Sub-second precision is OS and fs dependant. !err && (mtime_diff < 2) || err && err.code === 'ENOSYS', `FAILED: expect_ok ${util.inspect(arguments)} check_mtime: ${mtime_diff}` @@ -82,7 +82,7 @@ runTests(cases.values()); function runTests(iter) { const { value, done } = iter.next(); if (done) return; - // Support easy setting same or different atime / mtime values + // Support easy setting same or different atime / mtime values. const [atime, mtime] = Array.isArray(value) ? value : [value, value]; let fd; @@ -119,7 +119,7 @@ function runTests(iter) { fs.utimesSync(tmpdir.path, atime, mtime); expect_ok('utimesSync', tmpdir.path, undefined, atime, mtime); - // some systems don't have futimes + // Some systems don't have futimes // if there's an error, it should be ENOSYS try { fs.futimesSync(fd, atime, mtime); diff --git a/test/parallel/test-fs-write-file.js b/test/parallel/test-fs-write-file.js index 7f0ec116f1c632..b9536bea4ca131 100644 --- a/test/parallel/test-fs-write-file.js +++ b/test/parallel/test-fs-write-file.js @@ -48,7 +48,7 @@ fs.writeFile(filename, s, common.mustCall(function(e) { })); })); -// test that writeFile accepts buffers +// Test that writeFile accepts buffers. const filename2 = join(tmpdir.path, 'test2.txt'); const buf = Buffer.from(s, 'utf8'); @@ -62,14 +62,14 @@ fs.writeFile(filename2, buf, common.mustCall(function(e) { })); })); -// test that writeFile accepts numbers. +// Test that writeFile accepts numbers. const filename3 = join(tmpdir.path, 'test3.txt'); const m = 0o600; fs.writeFile(filename3, n, { mode: m }, common.mustCall(function(e) { assert.ifError(e); - // windows permissions aren't unix + // Windows permissions aren't Unix. if (!common.isWindows) { const st = fs.statSync(filename3); assert.strictEqual(st.mode & 0o700, m); @@ -82,7 +82,7 @@ fs.writeFile(filename3, n, { mode: m }, common.mustCall(function(e) { })); })); -// Test that writeFile accepts file descriptors +// Test that writeFile accepts file descriptors. const filename4 = join(tmpdir.path, 'test4.txt'); fs.open(filename4, 'w+', common.mustCall(function(e, fd) { diff --git a/test/parallel/test-fs-write-stream-err.js b/test/parallel/test-fs-write-stream-err.js index 36bf9dbcfb068e..0db517da2a58d9 100644 --- a/test/parallel/test-fs-write-stream-err.js +++ b/test/parallel/test-fs-write-stream-err.js @@ -38,17 +38,17 @@ fs.write = function() { switch (writeCalls++) { case 0: console.error('first write'); - // first time is ok. + // First time is ok. return write.apply(fs, arguments); case 1: - // then it breaks + // Then it breaks. console.error('second write'); const cb = arguments[arguments.length - 1]; return process.nextTick(function() { cb(err); }); default: - // and should not be called again! + // It should not be called again! throw new Error('BOOM!'); } }; diff --git a/test/parallel/test-http-agent-destroyed-socket.js b/test/parallel/test-http-agent-destroyed-socket.js index 145dc484248ef0..5b58ef0f52a50b 100644 --- a/test/parallel/test-http-agent-destroyed-socket.js +++ b/test/parallel/test-http-agent-destroyed-socket.js @@ -41,7 +41,7 @@ const server = http.createServer(common.mustCall((req, res) => { }; const request1 = http.get(requestOptions, common.mustCall((response) => { - // assert request2 is queued in the agent + // Assert request2 is queued in the agent const key = agent.getName(requestOptions); assert.strictEqual(agent.requests[key].length, 1); response.resume(); diff --git a/test/parallel/test-http-agent-keepalive.js b/test/parallel/test-http-agent-keepalive.js index 4d682a89ab7a54..7e2cef4e3e7ee6 100644 --- a/test/parallel/test-http-agent-keepalive.js +++ b/test/parallel/test-http-agent-keepalive.js @@ -62,7 +62,7 @@ function checkDataAndSockets(body) { } function second() { - // request second, use the same socket + // Request second, use the same socket get('/second', common.mustCall((res) => { assert.strictEqual(res.statusCode, 200); res.on('data', checkDataAndSockets); @@ -79,7 +79,7 @@ function second() { } function remoteClose() { - // mock remote server close the socket + // Mock remote server close the socket get('/remote_close', common.mustCall((res) => { assert.deepStrictEqual(res.statusCode, 200); res.on('data', checkDataAndSockets); @@ -89,7 +89,7 @@ function remoteClose() { process.nextTick(common.mustCall(() => { assert.strictEqual(agent.sockets[name], undefined); assert.strictEqual(agent.freeSockets[name].length, 1); - // waiting remote server close the socket + // Waiting remote server close the socket setTimeout(common.mustCall(() => { assert.strictEqual(agent.sockets[name], undefined); assert.strictEqual(agent.freeSockets[name], undefined); @@ -101,7 +101,7 @@ function remoteClose() { } function remoteError() { - // remote server will destroy the socket + // Remote server will destroy the socket const req = get('/error', common.mustNotCall()); req.on('error', common.mustCall((err) => { assert(err); diff --git a/test/parallel/test-http-client-response-domain.js b/test/parallel/test-http-client-response-domain.js index 617dc729acb71f..ace9efc7527087 100644 --- a/test/parallel/test-http-client-response-domain.js +++ b/test/parallel/test-http-client-response-domain.js @@ -30,7 +30,7 @@ let d; const tmpdir = require('../common/tmpdir'); tmpdir.refresh(); -// first fire up a simple HTTP server +// First fire up a simple HTTP server const server = http.createServer(function(req, res) { res.writeHead(200); res.end(); diff --git a/test/parallel/test-http-client-spurious-aborted.js b/test/parallel/test-http-client-spurious-aborted.js index 8f05f0cb36a2a6..296b4bd256c929 100644 --- a/test/parallel/test-http-client-spurious-aborted.js +++ b/test/parallel/test-http-client-spurious-aborted.js @@ -67,7 +67,7 @@ function download() { assert.strictEqual(aborted, abortRequest); finishCountdown.dec(); if (finishCountdown.remaining === 0) return; - abortRequest = false; // next one should be a good response + abortRequest = false; // Next one should be a good response download(); }); }); diff --git a/test/parallel/test-http-client-timeout-event.js b/test/parallel/test-http-client-timeout-event.js index c76d56ef256407..71767bef8f1641 100644 --- a/test/parallel/test-http-client-timeout-event.js +++ b/test/parallel/test-http-client-timeout-event.js @@ -36,7 +36,7 @@ server.listen(0, options.host, function() { options.port = this.address().port; const req = http.request(options); req.on('error', function() { - // this space is intentionally left blank + // This space is intentionally left blank }); req.on('close', common.mustCall(() => server.close())); diff --git a/test/parallel/test-http-client-timeout-option.js b/test/parallel/test-http-client-timeout-option.js index 6741fbe0bd1e35..70837d829e01f4 100644 --- a/test/parallel/test-http-client-timeout-option.js +++ b/test/parallel/test-http-client-timeout-option.js @@ -17,7 +17,7 @@ server.listen(0, options.host, function() { options.port = this.address().port; const req = http.request(options); req.on('error', function() { - // this space is intentionally left blank + // This space is intentionally left blank }); req.on('close', common.mustCall(() => server.close())); diff --git a/test/parallel/test-http-client-timeout-with-data.js b/test/parallel/test-http-client-timeout-with-data.js index bc5670b6939e39..a3f7fdd9297356 100644 --- a/test/parallel/test-http-client-timeout-with-data.js +++ b/test/parallel/test-http-client-timeout-with-data.js @@ -46,7 +46,7 @@ server.listen(0, options.host, function() { function onresponse(res) { req.setTimeout(50, common.mustCall(function() { - assert.strictEqual(nchunks, 1); // should have received the first chunk + assert.strictEqual(nchunks, 1); // Should have received the first chunk server.emit('timeout'); })); diff --git a/test/parallel/test-http-client-timeout.js b/test/parallel/test-http-client-timeout.js index bf0a3fbe54f8ce..90a3bebebc9e13 100644 --- a/test/parallel/test-http-client-timeout.js +++ b/test/parallel/test-http-client-timeout.js @@ -32,13 +32,13 @@ const options = { }; const server = http.createServer(function(req, res) { - // this space intentionally left blank + // This space intentionally left blank }); server.listen(0, options.host, function() { options.port = this.address().port; const req = http.request(options, function(res) { - // this space intentionally left blank + // This space intentionally left blank }); req.on('close', function() { server.close(); diff --git a/test/parallel/test-http-conn-reset.js b/test/parallel/test-http-conn-reset.js index fef75b72891e9c..e218bbfdcea3f7 100644 --- a/test/parallel/test-http-conn-reset.js +++ b/test/parallel/test-http-conn-reset.js @@ -38,7 +38,7 @@ const server = net.createServer(function(client) { }); server.listen(0, options.host, common.mustCall(onListen)); -// do a GET request, expect it to fail +// Do a GET request, expect it to fail function onListen() { options.port = this.address().port; const req = http.request(options, common.mustNotCall()); diff --git a/test/parallel/test-http-outgoing-finish-writable.js b/test/parallel/test-http-outgoing-finish-writable.js index 033e9b6bc1a7db..e03901fb6ddf07 100644 --- a/test/parallel/test-http-outgoing-finish-writable.js +++ b/test/parallel/test-http-outgoing-finish-writable.js @@ -31,7 +31,7 @@ server.on('listening', common.mustCall(function() { assert.strictEqual(clientRequest.writable, true); clientRequest.end(); - // writable is still true when close + // Writable is still true when close // THIS IS LEGACY, we cannot change it // unless we break error detection assert.strictEqual(clientRequest.writable, true); diff --git a/test/parallel/test-http-outgoing-settimeout.js b/test/parallel/test-http-outgoing-settimeout.js index 6e46973bc10631..3065c53f11191a 100644 --- a/test/parallel/test-http-outgoing-settimeout.js +++ b/test/parallel/test-http-outgoing-settimeout.js @@ -5,7 +5,7 @@ const assert = require('assert'); const { OutgoingMessage } = require('http'); { - // tests for settimeout method with socket + // Tests for settimeout method with socket const expectedMsecs = 42; const outgoingMessage = new OutgoingMessage(); outgoingMessage.socket = { diff --git a/test/parallel/test-http-parser.js b/test/parallel/test-http-parser.js index 5503b2284b85fd..6d664cfc0adb90 100644 --- a/test/parallel/test-http-parser.js +++ b/test/parallel/test-http-parser.js @@ -179,7 +179,7 @@ function expectBody(expected) { let seen_body = false; const onHeaders = (headers) => { - assert.ok(seen_body); // trailers should come after the body + assert.ok(seen_body); // Trailers should come after the body assert.deepStrictEqual(headers, ['Vary', '*', 'Content-Type', 'text/plain']); }; @@ -190,7 +190,7 @@ function expectBody(expected) { assert.strictEqual(url || parser.url, '/it'); assert.strictEqual(versionMajor, 1); assert.strictEqual(versionMinor, 1); - // expect to see trailing headers now + // Expect to see trailing headers now parser[kOnHeaders] = mustCall(onHeaders); }; diff --git a/test/parallel/test-http-res-write-after-end.js b/test/parallel/test-http-res-write-after-end.js index 75cb25f0a63e0c..bf6b7a3842e519 100644 --- a/test/parallel/test-http-res-write-after-end.js +++ b/test/parallel/test-http-res-write-after-end.js @@ -34,7 +34,7 @@ const server = http.Server(common.mustCall(function(req, res) { res.end(); const r = res.write('This should raise an error.'); - // write after end should return true + // Write after end should return true assert.strictEqual(r, true); })); diff --git a/test/parallel/test-http-res-write-end-dont-take-array.js b/test/parallel/test-http-res-write-end-dont-take-array.js index 39ac800d0d736c..f801da246edcef 100644 --- a/test/parallel/test-http-res-write-end-dont-take-array.js +++ b/test/parallel/test-http-res-write-end-dont-take-array.js @@ -40,7 +40,7 @@ server.once('request', common.mustCall((req, res) => { name: 'TypeError [ERR_INVALID_ARG_TYPE]', }; - // write should not accept an Array + // Write should not accept an Array assert.throws( () => { res.write(['array']); @@ -48,7 +48,7 @@ server.once('request', common.mustCall((req, res) => { expectedError ); - // end should not accept an Array + // End should not accept an Array assert.throws( () => { res.end(['moo']); @@ -64,7 +64,7 @@ server.listen(0, function() { // Just make a request, other tests handle responses http.get({ port: this.address().port }, (res) => { res.resume(); - // do it again to test .end(Buffer); + // Do it again to test .end(Buffer); http.get({ port: server.address().port }, (res) => { res.resume(); server.close(); diff --git a/test/parallel/test-http-server-multiheaders2.js b/test/parallel/test-http-server-multiheaders2.js index a8878d29518f9a..95ee5b61fa916d 100644 --- a/test/parallel/test-http-server-multiheaders2.js +++ b/test/parallel/test-http-server-multiheaders2.js @@ -65,7 +65,7 @@ const multipleForbidden = [ 'Location', 'Max-Forwards', - // special case, tested differently + // Special case, tested differently // 'Content-Length', ]; diff --git a/test/parallel/test-http-set-trailers.js b/test/parallel/test-http-set-trailers.js index 3252ac7fc0af2a..9068ef8f769937 100644 --- a/test/parallel/test-http-set-trailers.js +++ b/test/parallel/test-http-set-trailers.js @@ -36,7 +36,7 @@ const server = http.createServer(function(req, res) { server.listen(0); -// first, we test an HTTP/1.0 request. +// First, we test an HTTP/1.0 request. server.on('listening', function() { const c = net.createConnection(this.address().port); let res_buffer = ''; @@ -66,7 +66,7 @@ server.on('listening', function() { }); }); -// now, we test an HTTP/1.1 request. +// Now, we test an HTTP/1.1 request. server.on('listening', function() { const c = net.createConnection(this.address().port); let res_buffer = ''; diff --git a/test/parallel/test-http-url.parse-basic.js b/test/parallel/test-http-url.parse-basic.js index e68df80e9151d7..e03f39aa9035eb 100644 --- a/test/parallel/test-http-url.parse-basic.js +++ b/test/parallel/test-http-url.parse-basic.js @@ -29,7 +29,7 @@ let testURL; // make sure the basics work function check(request) { - // default method should still be get + // Default method should still be 'GET' assert.strictEqual(request.method, 'GET'); // There are no URL params, so you should not see any assert.strictEqual(request.url, '/'); diff --git a/test/parallel/test-http-url.parse-search.js b/test/parallel/test-http-url.parse-search.js index 111cf97874b4d3..d10713f5f1a7cb 100644 --- a/test/parallel/test-http-url.parse-search.js +++ b/test/parallel/test-http-url.parse-search.js @@ -26,7 +26,7 @@ const http = require('http'); const url = require('url'); function check(request) { - // a path should come over with params + // A path should come over with params assert.strictEqual(request.url, '/asdf?qwer=zxcv'); } diff --git a/test/parallel/test-http-writable-true-after-close.js b/test/parallel/test-http-writable-true-after-close.js index a1915dd69c5da8..c0db7c34492762 100644 --- a/test/parallel/test-http-writable-true-after-close.js +++ b/test/parallel/test-http-writable-true-after-close.js @@ -18,7 +18,7 @@ const server = createServer(common.mustCall((req, res) => { // on CentOS 5, 'finish' is emitted res.on('finish', listener); - // everywhere else, 'close' is emitted + // Everywhere else, 'close' is emitted res.on('close', listener); get(`http://127.0.0.1:${internal.address().port}`, common.mustCall((inner) => { diff --git a/test/parallel/test-http2-client-destroy.js b/test/parallel/test-http2-client-destroy.js index 6c4adfe5b449c3..e7ea37e1528ef6 100644 --- a/test/parallel/test-http2-client-destroy.js +++ b/test/parallel/test-http2-client-destroy.js @@ -49,7 +49,7 @@ const Countdown = require('../common/countdown'); })); } -// test destroy before client operations +// Test destroy before client operations { const server = h2.createServer(); server.listen(0, common.mustCall(() => { @@ -81,7 +81,7 @@ const Countdown = require('../common/countdown'); common.expectsError(() => client.settings({}), sessionError); common.expectsError(() => client.goaway(), sessionError); common.expectsError(() => client.request(), sessionError); - client.close(); // should be a non-op at this point + client.close(); // Should be a non-op at this point // Wait for setImmediate call from destroy() to complete // so that state.destroyed is set to true @@ -91,7 +91,7 @@ const Countdown = require('../common/countdown'); common.expectsError(() => client.settings({}), sessionError); common.expectsError(() => client.goaway(), sessionError); common.expectsError(() => client.request(), sessionError); - client.close(); // should be a non-op at this point + client.close(); // Should be a non-op at this point }); req.resume(); diff --git a/test/parallel/test-http2-client-priority-before-connect.js b/test/parallel/test-http2-client-priority-before-connect.js index a9615d2cd69f12..7aa13a5e45418e 100644 --- a/test/parallel/test-http2-client-priority-before-connect.js +++ b/test/parallel/test-http2-client-priority-before-connect.js @@ -7,7 +7,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall((stream) => { stream.respond(); stream.end('ok'); diff --git a/test/parallel/test-http2-client-settings-before-connect.js b/test/parallel/test-http2-client-settings-before-connect.js index ceea1bc39ad7d3..ce888bb4416c09 100644 --- a/test/parallel/test-http2-client-settings-before-connect.js +++ b/test/parallel/test-http2-client-settings-before-connect.js @@ -7,7 +7,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall((stream, headers, flags) => { stream.respond(); stream.end('ok'); diff --git a/test/parallel/test-http2-client-shutdown-before-connect.js b/test/parallel/test-http2-client-shutdown-before-connect.js index bd971ebf7de69c..7e6a1a55c1d40a 100644 --- a/test/parallel/test-http2-client-shutdown-before-connect.js +++ b/test/parallel/test-http2-client-shutdown-before-connect.js @@ -7,7 +7,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustNotCall()); server.listen(0, common.mustCall(() => { diff --git a/test/parallel/test-http2-client-socket-destroy.js b/test/parallel/test-http2-client-socket-destroy.js index 3eb7e898edcfc1..a91c6da28d1813 100644 --- a/test/parallel/test-http2-client-socket-destroy.js +++ b/test/parallel/test-http2-client-socket-destroy.js @@ -13,7 +13,7 @@ const body = const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall((stream) => { stream.on('aborted', common.mustCall()); stream.on('close', common.mustCall()); diff --git a/test/parallel/test-http2-client-write-before-connect.js b/test/parallel/test-http2-client-write-before-connect.js index 6588d7dccd139d..6efefc5870e75f 100644 --- a/test/parallel/test-http2-client-write-before-connect.js +++ b/test/parallel/test-http2-client-write-before-connect.js @@ -8,7 +8,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall((stream, headers, flags) => { let data = ''; stream.setEncoding('utf8'); diff --git a/test/parallel/test-http2-cookies.js b/test/parallel/test-http2-cookies.js index 275fbf05e79460..fcd6b847587470 100644 --- a/test/parallel/test-http2-cookies.js +++ b/test/parallel/test-http2-cookies.js @@ -14,7 +14,7 @@ const setCookie = [ 'e=f' ]; -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream)); function onStream(stream, headers, flags) { diff --git a/test/parallel/test-http2-create-client-session.js b/test/parallel/test-http2-create-client-session.js index 35de927ea7924e..b2d6ddbe7a03e1 100644 --- a/test/parallel/test-http2-create-client-session.js +++ b/test/parallel/test-http2-create-client-session.js @@ -13,7 +13,7 @@ const body = const server = h2.createServer(); const count = 100; -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream, count)); function onStream(stream, headers, flags) { diff --git a/test/parallel/test-http2-createwritereq.js b/test/parallel/test-http2-createwritereq.js index 1575424d1609b4..3015ad6c642801 100644 --- a/test/parallel/test-http2-createwritereq.js +++ b/test/parallel/test-http2-createwritereq.js @@ -24,7 +24,7 @@ const encodings = { 'ucs-2': 'ucs2', 'utf16le': 'ucs2', 'utf-16le': 'ucs2', - 'UTF8': 'utf8' // should fall through to Buffer.from + 'UTF8': 'utf8' // Should fall through to Buffer.from }; const testsToRun = Object.keys(encodings).length; diff --git a/test/parallel/test-http2-info-headers.js b/test/parallel/test-http2-info-headers.js index 132818c4090037..ec95a9d3d93185 100644 --- a/test/parallel/test-http2-info-headers.js +++ b/test/parallel/test-http2-info-headers.js @@ -8,7 +8,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream)); const status101regex = diff --git a/test/parallel/test-http2-methods.js b/test/parallel/test-http2-methods.js index a291bdf00800d5..143b50b66b4dff 100644 --- a/test/parallel/test-http2-methods.js +++ b/test/parallel/test-http2-methods.js @@ -11,7 +11,7 @@ const server = h2.createServer(); const methods = [undefined, 'GET', 'POST', 'PATCH', 'FOO', 'A B C']; let expected = methods.length; -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream, expected)); function onStream(stream, headers, flags) { diff --git a/test/parallel/test-http2-no-wanttrailers-listener.js b/test/parallel/test-http2-no-wanttrailers-listener.js index 87bc21df48aa2c..09293f2584a4ef 100644 --- a/test/parallel/test-http2-no-wanttrailers-listener.js +++ b/test/parallel/test-http2-no-wanttrailers-listener.js @@ -7,7 +7,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream)); function onStream(stream, headers, flags) { diff --git a/test/parallel/test-http2-options-max-headers-block-length.js b/test/parallel/test-http2-options-max-headers-block-length.js index 0706e6a83e6d48..18f72bf1defb22 100644 --- a/test/parallel/test-http2-options-max-headers-block-length.js +++ b/test/parallel/test-http2-options-max-headers-block-length.js @@ -8,7 +8,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustNotCall()); server.listen(0, common.mustCall(() => { diff --git a/test/parallel/test-http2-options-max-reserved-streams.js b/test/parallel/test-http2-options-max-reserved-streams.js index 6dbf54bf31c980..44c495b8330480 100644 --- a/test/parallel/test-http2-options-max-reserved-streams.js +++ b/test/parallel/test-http2-options-max-reserved-streams.js @@ -15,7 +15,7 @@ const countdown = new Countdown(3, () => { client.close(); }); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall((stream) => { // The first pushStream will complete as normal stream.pushStream({ diff --git a/test/parallel/test-http2-perf_hooks.js b/test/parallel/test-http2-perf_hooks.js index 4264915294827c..0fcbc323e01301 100644 --- a/test/parallel/test-http2-perf_hooks.js +++ b/test/parallel/test-http2-perf_hooks.js @@ -62,7 +62,7 @@ const body = const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream)); function onStream(stream, headers, flags) { diff --git a/test/parallel/test-http2-priority-event.js b/test/parallel/test-http2-priority-event.js index fe04ffb342d70d..41ec6534b2de53 100644 --- a/test/parallel/test-http2-priority-event.js +++ b/test/parallel/test-http2-priority-event.js @@ -8,7 +8,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream)); function onPriority(stream, parent, weight, exclusive) { diff --git a/test/parallel/test-http2-respond-file-fd-errors.js b/test/parallel/test-http2-respond-file-fd-errors.js index 078d0eb11e451d..9508cfae9799c0 100644 --- a/test/parallel/test-http2-respond-file-fd-errors.js +++ b/test/parallel/test-http2-respond-file-fd-errors.js @@ -29,7 +29,7 @@ const fd = fs.openSync(fname, 'r'); const server = http2.createServer(); server.on('stream', common.mustCall((stream) => { - // should throw if fd isn't a number + // Should throw if fd isn't a number Object.keys(types).forEach((type) => { if (type === 'number') { return; diff --git a/test/parallel/test-http2-respond-file-fd-invalid.js b/test/parallel/test-http2-respond-file-fd-invalid.js index 7630b93bc63942..64c8ba541fb2a9 100644 --- a/test/parallel/test-http2-respond-file-fd-invalid.js +++ b/test/parallel/test-http2-respond-file-fd-invalid.js @@ -26,7 +26,7 @@ server.on('stream', (stream) => { try { while (fs.fstatSync(++fd)); } catch { - // do nothing; we now have an invalid fd + // Do nothing; we now have an invalid fd } stream.respondWithFD(fd); diff --git a/test/parallel/test-http2-respond-nghttperrors.js b/test/parallel/test-http2-respond-nghttperrors.js index d720ec1fa486f7..3bdfbffeec4e3c 100644 --- a/test/parallel/test-http2-respond-nghttperrors.js +++ b/test/parallel/test-http2-respond-nghttperrors.js @@ -13,7 +13,7 @@ const { } = internalBinding('http2'); const { NghttpError } = require('internal/http2/util'); -// tests error handling within respond +// Tests error handling within respond // - every other NGHTTP2 error from binding (should emit stream error) const specificTestKeys = []; diff --git a/test/parallel/test-http2-server-errors.js b/test/parallel/test-http2-server-errors.js index eeb9e79682e344..fec6cc84bec72a 100644 --- a/test/parallel/test-http2-server-errors.js +++ b/test/parallel/test-http2-server-errors.js @@ -41,7 +41,7 @@ const h2 = require('http2'); }; const request = client.request(headers); request.on('data', common.mustCall(function(chunk) { - // cause an error on the server side + // Cause an error on the server side client.destroy(); })); request.end(); @@ -81,7 +81,7 @@ const h2 = require('http2'); }; const request = client.request(headers); request.on('data', common.mustCall(function(chunk) { - // cause an error on the server side + // Cause an error on the server side client.destroy(); })); request.end(); diff --git a/test/parallel/test-http2-server-push-stream-errors.js b/test/parallel/test-http2-server-push-stream-errors.js index fb6fc11b63f999..35d8b796e47adc 100644 --- a/test/parallel/test-http2-server-push-stream-errors.js +++ b/test/parallel/test-http2-server-push-stream-errors.js @@ -13,7 +13,7 @@ const { } = internalBinding('http2'); const { NghttpError } = require('internal/http2/util'); -// tests error handling within pushStream +// Tests error handling within pushStream // - NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE (should emit session error) // - NGHTTP2_ERR_STREAM_CLOSED (should emit stream error) // - every other NGHTTP2 error from binding (should emit stream error) diff --git a/test/parallel/test-http2-server-push-stream-head.js b/test/parallel/test-http2-server-push-stream-head.js index 35e22c0ce3b561..c1db3ce81e4108 100644 --- a/test/parallel/test-http2-server-push-stream-head.js +++ b/test/parallel/test-http2-server-push-stream-head.js @@ -21,7 +21,7 @@ server.on('stream', common.mustCall((stream, headers) => { }, common.mustCall((err, push, headers) => { assert.strictEqual(push._writableState.ended, true); push.respond(); - // cannot write to push() anymore + // Cannot write to push() anymore push.on('error', common.expectsError({ type: Error, code: 'ERR_STREAM_WRITE_AFTER_END', diff --git a/test/parallel/test-http2-server-rst-before-respond.js b/test/parallel/test-http2-server-rst-before-respond.js index e7218aaeea29af..78fca25a82c1f8 100644 --- a/test/parallel/test-http2-server-rst-before-respond.js +++ b/test/parallel/test-http2-server-rst-before-respond.js @@ -8,7 +8,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream)); function onStream(stream, headers, flags) { diff --git a/test/parallel/test-http2-server-shutdown-before-respond.js b/test/parallel/test-http2-server-shutdown-before-respond.js index 33f224fc69a9d5..65dd853f8392c2 100644 --- a/test/parallel/test-http2-server-shutdown-before-respond.js +++ b/test/parallel/test-http2-server-shutdown-before-respond.js @@ -7,7 +7,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream)); function onStream(stream, headers, flags) { diff --git a/test/parallel/test-http2-server-socket-destroy.js b/test/parallel/test-http2-server-socket-destroy.js index 99595aeb63004d..e7fbc2ceb7d1b3 100644 --- a/test/parallel/test-http2-server-socket-destroy.js +++ b/test/parallel/test-http2-server-socket-destroy.js @@ -11,7 +11,7 @@ const { kSocket } = require('internal/http2/util'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream)); function onStream(stream) { diff --git a/test/parallel/test-http2-timeouts.js b/test/parallel/test-http2-timeouts.js index de8311a1491da8..3a75d63580e1cc 100644 --- a/test/parallel/test-http2-timeouts.js +++ b/test/parallel/test-http2-timeouts.js @@ -7,7 +7,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall((stream) => { stream.setTimeout(1, common.mustCall(() => { stream.respond({ ':status': 200 }); diff --git a/test/parallel/test-http2-trailers.js b/test/parallel/test-http2-trailers.js index bdc0931157ad58..98b9b5d4a09fac 100644 --- a/test/parallel/test-http2-trailers.js +++ b/test/parallel/test-http2-trailers.js @@ -12,7 +12,7 @@ const trailerValue = 'testing'; const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream)); function onStream(stream, headers, flags) { diff --git a/test/parallel/test-https-agent-create-connection.js b/test/parallel/test-https-agent-create-connection.js index c174f90d7df131..c0b50cef01abe4 100644 --- a/test/parallel/test-https-agent-create-connection.js +++ b/test/parallel/test-https-agent-create-connection.js @@ -74,7 +74,7 @@ function createServer() { })); } -// use port and host and option connect +// Use port and host and option connect { const server = createServer(); server.listen(0, common.mustCall(() => { diff --git a/test/parallel/test-intl.js b/test/parallel/test-intl.js index c55f554b00f55a..255bf066aa0ff8 100644 --- a/test/parallel/test-intl.js +++ b/test/parallel/test-intl.js @@ -23,7 +23,7 @@ const common = require('../common'); const assert = require('assert'); -// does node think that i18n was enabled? +// Does node think that i18n was enabled? let enablei18n = process.config.variables.v8_enable_i18n_support; if (enablei18n === undefined) { enablei18n = 0; diff --git a/test/parallel/test-listen-fd-ebadf.js b/test/parallel/test-listen-fd-ebadf.js index 3ec40b5c23a1f2..351500be2824f1 100644 --- a/test/parallel/test-listen-fd-ebadf.js +++ b/test/parallel/test-listen-fd-ebadf.js @@ -35,7 +35,7 @@ let invalidFd = 2; try { while (fs.fstatSync(++invalidFd)); } catch { - // do nothing; we now have an invalid fd + // Do nothing; we now have an invalid fd } net.createServer(common.mustNotCall()).listen({ fd: invalidFd }) diff --git a/test/parallel/test-microtask-queue-run-immediate.js b/test/parallel/test-microtask-queue-run-immediate.js index 4d998cf0b8a59c..2d4e21f83aa6ef 100644 --- a/test/parallel/test-microtask-queue-run-immediate.js +++ b/test/parallel/test-microtask-queue-run-immediate.js @@ -41,7 +41,7 @@ setImmediate(function() { }); -// no nextTick, microtask with nextTick +// No nextTick, microtask with nextTick setImmediate(function() { let called = false; diff --git a/test/parallel/test-microtask-queue-run.js b/test/parallel/test-microtask-queue-run.js index 85eb770da1e0ff..7a1667819f6758 100644 --- a/test/parallel/test-microtask-queue-run.js +++ b/test/parallel/test-microtask-queue-run.js @@ -41,7 +41,7 @@ setTimeout(function() { }, 0); -// no nextTick, microtask with nextTick +// No nextTick, microtask with nextTick setTimeout(function() { let called = false; diff --git a/test/parallel/test-module-relative-lookup.js b/test/parallel/test-module-relative-lookup.js index c5350e11facda4..e9d6112da752f8 100644 --- a/test/parallel/test-module-relative-lookup.js +++ b/test/parallel/test-module-relative-lookup.js @@ -2,7 +2,7 @@ const common = require('../common'); const assert = require('assert'); -const _module = require('module'); // avoid collision with global.module +const _module = require('module'); // Avoid collision with global.module // Current directory gets highest priority for local modules function testFirstInPath(moduleName, isLocalModule) { diff --git a/test/parallel/test-net-keepalive.js b/test/parallel/test-net-keepalive.js index 9cc08af8fe4372..d91ec625f88246 100644 --- a/test/parallel/test-net-keepalive.js +++ b/test/parallel/test-net-keepalive.js @@ -38,7 +38,7 @@ const echoServer = net.createServer(function(connection) { }, 1), common.platformTimeout(100)); connection.setTimeout(0); assert.notStrictEqual(connection.setKeepAlive, undefined); - // send a keepalive packet after 50 ms + // Send a keepalive packet after 50 ms connection.setKeepAlive(true, common.platformTimeout(50)); connection.on('end', function() { connection.end(); diff --git a/test/parallel/test-net-persistent-keepalive.js b/test/parallel/test-net-persistent-keepalive.js index 85a2950273a6a3..b25162996e1bd0 100644 --- a/test/parallel/test-net-persistent-keepalive.js +++ b/test/parallel/test-net-persistent-keepalive.js @@ -25,7 +25,7 @@ echoServer.listen(0); echoServer.on('listening', function() { clientConnection = new net.Socket(); - // send a keepalive packet after 1000 ms + // Send a keepalive packet after 1000 ms // and make sure it persists const s = clientConnection.setKeepAlive(true, 400); assert.ok(s instanceof net.Socket); diff --git a/test/parallel/test-net-server-connections-child-null.js b/test/parallel/test-net-server-connections-child-null.js index 46084404c87661..bf75826fddb15b 100644 --- a/test/parallel/test-net-server-connections-child-null.js +++ b/test/parallel/test-net-server-connections-child-null.js @@ -33,7 +33,7 @@ if (process.argv[2] === 'child') { const connect = net.connect(server.address().port); connect.on('close', common.mustCall(() => { - // now server.connections should be null + // `server.connections` should now be null. assert.strictEqual(server.connections, null); server.close(); })); diff --git a/test/parallel/test-path-join.js b/test/parallel/test-path-join.js index a9fb5b1e927552..6243d97ce8a8bc 100644 --- a/test/parallel/test-path-join.js +++ b/test/parallel/test-path-join.js @@ -8,7 +8,7 @@ const backslashRE = /\\/g; const joinTests = [ [ [path.posix.join, path.win32.join], - // arguments result + // Arguments result [[['.', 'x/b', '..', '/b/c.js'], 'x/b/c.js'], [[], '.'], [['/.', 'x/b', '..', '/b/c.js'], '/x/b/c.js'], @@ -64,7 +64,7 @@ const joinTests = [ joinTests.push([ path.win32.join, joinTests[0][1].slice(0).concat( - [// arguments result + [// Arguments result // UNC path expected [['//foo/bar'], '\\\\foo\\bar\\'], [['\\/foo/bar'], '\\\\foo\\bar\\'], diff --git a/test/parallel/test-path-relative.js b/test/parallel/test-path-relative.js index 26521bc088a8f7..5d5d118cc6f45c 100644 --- a/test/parallel/test-path-relative.js +++ b/test/parallel/test-path-relative.js @@ -7,7 +7,7 @@ const failures = []; const relativeTests = [ [ path.win32.relative, - // arguments result + // Arguments result [['c:/blah\\blah', 'd:/games', 'd:\\games'], ['c:/aaaa/bbbb', 'c:/aaaa', '..'], ['c:/aaaa/bbbb', 'c:/cccc', '..\\..\\cccc'], diff --git a/test/parallel/test-path-resolve.js b/test/parallel/test-path-resolve.js index 79c2d679204007..e9e6d83ff54007 100644 --- a/test/parallel/test-path-resolve.js +++ b/test/parallel/test-path-resolve.js @@ -28,7 +28,7 @@ const resolveTests = [ ] ], [ path.posix.resolve, - // arguments result + // Arguments result [[['/var/lib', '../', 'file/'], '/var/file'], [['/var/lib', '/../', 'file/'], '/file'], [['a/b/c/', '../../..'], process.cwd()], diff --git a/test/parallel/test-preload.js b/test/parallel/test-preload.js index 3d754accae8a8c..326eed030ca1bb 100644 --- a/test/parallel/test-preload.js +++ b/test/parallel/test-preload.js @@ -25,14 +25,14 @@ const fixtureC = fixtures.path('printC.js'); const fixtureD = fixtures.path('define-global.js'); const fixtureThrows = fixtures.path('throws_error4.js'); -// test preloading a single module works +// Test preloading a single module works childProcess.exec(`"${nodeBinary}" ${preloadOption([fixtureA])} "${fixtureB}"`, function(err, stdout, stderr) { assert.ifError(err); assert.strictEqual(stdout, 'A\nB\n'); }); -// test preloading multiple modules works +// Test preloading multiple modules works childProcess.exec( `"${nodeBinary}" ${preloadOption([fixtureA, fixtureB])} "${fixtureC}"`, function(err, stdout, stderr) { @@ -78,7 +78,7 @@ stdinProc.on('close', function(code) { assert.strictEqual(stdinStdout, 'A\nhello\n'); }); -// test that preload can be used with repl +// Test that preload can be used with repl const replProc = childProcess.spawn( nodeBinary, ['-i', '--require', fixtureA], @@ -109,7 +109,7 @@ childProcess.exec( } ); -// test that preload works with -i +// Test that preload works with -i const interactive = childProcess.exec( `"${nodeBinary}" ${preloadOption([fixtureD])}-i`, common.mustCall(function(err, stdout, stderr) { diff --git a/test/parallel/test-process-env.js b/test/parallel/test-process-env.js index e1be9c6e1bf3fb..0e06306634c3e2 100644 --- a/test/parallel/test-process-env.js +++ b/test/parallel/test-process-env.js @@ -59,7 +59,7 @@ if (process.argv[2] === 'you-are-the-child') { child.stderr.on('data', function(data) { console.log(data.toString()); }); child.on('exit', function(statusCode) { if (statusCode !== 0) { - process.exit(statusCode); // failed assertion in child process + process.exit(statusCode); // Failed assertion in child process } }); } diff --git a/test/parallel/test-process-kill-pid.js b/test/parallel/test-process-kill-pid.js index e69be183fb7469..c299ceabaa674e 100644 --- a/test/parallel/test-process-kill-pid.js +++ b/test/parallel/test-process-kill-pid.js @@ -97,7 +97,7 @@ kill('0', undefined, 0, 15); kill(0, 1, 0, 1); kill(0, 15, 0, 15); -// negative numbers are meaningful on unix +// Negative numbers are meaningful on unix kill(-1, 'SIGHUP', -1, 1); kill(-1, undefined, -1, 15); kill('-1', 'SIGHUP', -1, 1); diff --git a/test/parallel/test-querystring.js b/test/parallel/test-querystring.js index 175098aed77575..b26f41a4663c8b 100644 --- a/test/parallel/test-querystring.js +++ b/test/parallel/test-querystring.js @@ -269,7 +269,7 @@ qsWeirdObjects.forEach((testCase) => { assert.strictEqual(qs.stringify(testCase[0]), testCase[1]); }); -// invalid surrogate pair throws URIError +// Invalid surrogate pair throws URIError common.expectsError( () => qs.stringify({ foo: '\udc00' }), { diff --git a/test/parallel/test-readline-interface.js b/test/parallel/test-readline-interface.js index 90cb8f1584f04b..fba215e225b03d 100644 --- a/test/parallel/test-readline-interface.js +++ b/test/parallel/test-readline-interface.js @@ -61,7 +61,7 @@ function isWarned(emitter) { } { - // set crlfDelay to float 100.5ms + // Set crlfDelay to float 100.5ms const fi = new FakeInput(); const rli = new readline.Interface({ input: fi, @@ -172,7 +172,7 @@ function isWarned(emitter) { rli.close(); } - // sending multiple newlines at once + // Sending multiple newlines at once { const fi = new FakeInput(); const rli = new readline.Interface( @@ -288,7 +288,7 @@ function isWarned(emitter) { }), delay * 2); } - // set crlfDelay to `Infinity` is allowed + // Set crlfDelay to `Infinity` is allowed { const fi = new FakeInput(); const delay = 200; @@ -515,7 +515,7 @@ function isWarned(emitter) { rli.close(); } - // calling readline without `new` + // Calling readline without `new` { const fi = new FakeInput(); const rli = readline.Interface( @@ -661,13 +661,13 @@ function isWarned(emitter) { }); fi.emit('data', '💻'); - // move left one character/code point + // Move left one character/code point fi.emit('keypress', '.', { name: 'left' }); let cursorPos = rli._getCursorPos(); assert.strictEqual(cursorPos.rows, 0); assert.strictEqual(cursorPos.cols, 0); - // move right one character/code point + // Move right one character/code point fi.emit('keypress', '.', { name: 'right' }); cursorPos = rli._getCursorPos(); assert.strictEqual(cursorPos.rows, 0); @@ -695,7 +695,7 @@ function isWarned(emitter) { }); fi.emit('data', '💻'); - // move left one character/code point + // Move left one character/code point fi.emit('keypress', '.', { name: 'left' }); let cursorPos = rli._getCursorPos(); assert.strictEqual(cursorPos.rows, 0); @@ -731,7 +731,7 @@ function isWarned(emitter) { }); fi.emit('data', '💻'); - // move left one character/code point + // Move left one character/code point fi.emit('keypress', '.', { name: 'right' }); let cursorPos = rli._getCursorPos(); assert.strictEqual(cursorPos.rows, 0); @@ -1104,7 +1104,7 @@ function isWarned(emitter) { assert.strictEqual(internalReadline.getStringWidth('안녕하세요'), 10); assert.strictEqual(internalReadline.getStringWidth('A\ud83c\ude00BC'), 5); - // check if vt control chars are stripped + // Check if vt control chars are stripped assert.strictEqual( internalReadline.stripVTControlCharacters('\u001b[31m> \u001b[39m'), '> ' diff --git a/test/parallel/test-repl-autolibs.js b/test/parallel/test-repl-autolibs.js index f069d8bf409799..976cad84361d03 100644 --- a/test/parallel/test-repl-autolibs.js +++ b/test/parallel/test-repl-autolibs.js @@ -37,10 +37,10 @@ function test1() { gotWrite = true; if (data.length) { - // inspect output matches repl output + // Inspect output matches repl output assert.strictEqual(data, `${util.inspect(require('fs'), null, 2, false)}\n`); - // globally added lib matches required lib + // Globally added lib matches required lib assert.strictEqual(global.fs, require('fs')); test2(); } @@ -57,7 +57,7 @@ function test2() { if (data.length) { // repl response error message assert.strictEqual(data, '{}\n'); - // original value wasn't overwritten + // Original value wasn't overwritten assert.strictEqual(val, global.url); } }; diff --git a/test/parallel/test-repl-context.js b/test/parallel/test-repl-context.js index 378af1c14445e8..001e2ffd4e1ede 100644 --- a/test/parallel/test-repl-context.js +++ b/test/parallel/test-repl-context.js @@ -41,14 +41,14 @@ const stream = new ArrayStream(); assert.ok(!server.underscoreAssigned); assert.strictEqual(server.lines.length, 0); - // an assignment to '_' in the repl server + // An assignment to '_' in the repl server server.write('_ = 500;\n'); assert.ok(server.underscoreAssigned); assert.strictEqual(server.lines.length, 1); assert.strictEqual(server.lines[0], '_ = 500;'); assert.strictEqual(server.last, 500); - // use the server to create a new context + // Use the server to create a new context const context = server.createContext(); // Ensure that creating a new context does not diff --git a/test/parallel/test-repl-history-navigation.js b/test/parallel/test-repl-history-navigation.js index 562b79dae846d4..b00f932aa9a253 100644 --- a/test/parallel/test-repl-history-navigation.js +++ b/test/parallel/test-repl-history-navigation.js @@ -50,7 +50,7 @@ const DOWN = { name: 'down' }; const prompt = '> '; const tests = [ - { // creates few history to navigate for + { // Creates few history to navigate for env: { NODE_REPL_HISTORY: defaultHistoryPath }, test: [ 'let ab = 45', ENTER, '555 + 909', ENTER, diff --git a/test/parallel/test-repl-save-load.js b/test/parallel/test-repl-save-load.js index 2c42788be6ffcc..74841d86ff6ec0 100644 --- a/test/parallel/test-repl-save-load.js +++ b/test/parallel/test-repl-save-load.js @@ -49,7 +49,7 @@ putIn.run(testFile); // save it to a file putIn.run([`.save ${saveFileName}`]); -// the file should have what I wrote +// The file should have what I wrote assert.strictEqual(fs.readFileSync(saveFileName, 'utf8'), `${testFile.join('\n')}\n`); @@ -104,7 +104,7 @@ putIn.write = function(data) { }; putIn.run([`.load ${loadFile}`]); -// throw error on loading directory +// Throw error on loading directory loadFile = tmpdir.path; putIn.write = function(data) { assert.strictEqual(data, `Failed to load:${loadFile} is not a valid file\n`); diff --git a/test/parallel/test-repl-tab-complete.js b/test/parallel/test-repl-tab-complete.js index b28923a49b1a5d..558b6cab47e2ae 100644 --- a/test/parallel/test-repl-tab-complete.js +++ b/test/parallel/test-repl-tab-complete.js @@ -384,7 +384,7 @@ testMe.complete('var log = console.lo', common.mustCall((error, data) => { assert.deepStrictEqual(data, [['console.log'], 'console.lo']); })); -// tab completion for defined commands +// Tab completion for defined commands putIn.run(['.clear']); testMe.complete('.b', common.mustCall((error, data) => { diff --git a/test/parallel/test-repl-underscore.js b/test/parallel/test-repl-underscore.js index cbf62c3b6e0308..30f679bcb14f49 100644 --- a/test/parallel/test-repl-underscore.js +++ b/test/parallel/test-repl-underscore.js @@ -15,7 +15,7 @@ testError(); function testSloppyMode() { const r = initRepl(repl.REPL_MODE_SLOPPY); - // cannot use `let` in sloppy mode + // Cannot use `let` in sloppy mode r.write(`_; // initial value undefined var x = 10; // evaluates to undefined _; // still undefined diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js index 0f88c661b2992a..0cda683aaabc47 100644 --- a/test/parallel/test-repl.js +++ b/test/parallel/test-repl.js @@ -32,7 +32,7 @@ const message = 'Read, Eval, Print Loop'; const prompt_unix = 'node via Unix socket> '; const prompt_tcp = 'node via TCP socket> '; -// absolute path to test/fixtures/a.js +// Absolute path to test/fixtures/a.js const moduleFilename = fixtures.path('a'); // function for REPL to run diff --git a/test/parallel/test-setproctitle.js b/test/parallel/test-setproctitle.js index 2ed0730eec1c80..05bdfa578dde3f 100644 --- a/test/parallel/test-setproctitle.js +++ b/test/parallel/test-setproctitle.js @@ -39,6 +39,6 @@ exec(cmd, common.mustCall((error, stdout, stderr) => { if (common.isFreeBSD || common.isOpenBSD) title += ` (${path.basename(process.execPath)})`; - // omitting trailing whitespace and \n + // Omitting trailing whitespace and \n assert.strictEqual(stdout.replace(/\s+$/, '').endsWith(title), true); })); diff --git a/test/parallel/test-stdout-stderr-reading.js b/test/parallel/test-stdout-stderr-reading.js index 6466366a4f07cb..57bfffa272af46 100644 --- a/test/parallel/test-stdout-stderr-reading.js +++ b/test/parallel/test-stdout-stderr-reading.js @@ -2,7 +2,7 @@ const common = require('../common'); const assert = require('assert'); -// verify that stdout is never read from. +// Verify that stdout is never read from. const net = require('net'); const read = net.Socket.prototype.read; @@ -59,7 +59,7 @@ function parent() { } function child() { - // should not be reading *ever* in here. + // Should not be reading *ever* in here. net.Socket.prototype.read = function() { throw new Error('no reading allowed in child'); }; diff --git a/test/parallel/test-stream-ispaused.js b/test/parallel/test-stream-ispaused.js index 366d34e326ec7d..a57928f9349194 100644 --- a/test/parallel/test-stream-ispaused.js +++ b/test/parallel/test-stream-ispaused.js @@ -32,7 +32,7 @@ readable._read = Function(); // Default state of a stream is not "paused" assert.ok(!readable.isPaused()); -// make the stream start flowing... +// Make the stream start flowing... readable.on('data', Function()); // still not paused. diff --git a/test/parallel/test-stream-readable-emittedReadable.js b/test/parallel/test-stream-readable-emittedReadable.js index 5b9affc59fbbf2..ba613f9e9ff19d 100644 --- a/test/parallel/test-stream-readable-emittedReadable.js +++ b/test/parallel/test-stream-readable-emittedReadable.js @@ -31,7 +31,7 @@ process.nextTick(common.mustCall(() => { readable.push('bar'); })); -// these triggers two readable events +// These triggers two readable events setImmediate(common.mustCall(() => { readable.push('quo'); process.nextTick(common.mustCall(() => { diff --git a/test/parallel/test-stream-readable-event.js b/test/parallel/test-stream-readable-event.js index 8276e7ce4db533..e248bed4b5b3e3 100644 --- a/test/parallel/test-stream-readable-event.js +++ b/test/parallel/test-stream-readable-event.js @@ -38,7 +38,7 @@ const Readable = require('stream').Readable; r.push(Buffer.from('blerg')); setTimeout(function() { - // we're testing what we think we are + // We're testing what we think we are assert(!r._readableState.reading); r.on('readable', common.mustCall()); }, 1); diff --git a/test/parallel/test-stream-readable-flow-recursion.js b/test/parallel/test-stream-readable-flow-recursion.js index fed4287445e035..bac6427fb097e5 100644 --- a/test/parallel/test-stream-readable-flow-recursion.js +++ b/test/parallel/test-stream-readable-flow-recursion.js @@ -67,7 +67,7 @@ flow(stream, 5000, function() { process.on('exit', function(code) { assert.strictEqual(reads, 2); - // we pushed up the high water mark + // We pushed up the high water mark assert.strictEqual(stream.readableHighWaterMark, 8192); // Length is 0 right now, because we pulled it all out. assert.strictEqual(stream.readableLength, 0); diff --git a/test/parallel/test-stream-readable-no-unneeded-readable.js b/test/parallel/test-stream-readable-no-unneeded-readable.js index 13ee2b498c4b96..20092b57d95871 100644 --- a/test/parallel/test-stream-readable-no-unneeded-readable.js +++ b/test/parallel/test-stream-readable-no-unneeded-readable.js @@ -17,7 +17,7 @@ function test(r) { if (data) { wrapper.push(data); } - // else the end event should fire + // else: the end event should fire }); }, }); diff --git a/test/parallel/test-stream-readable-reading-readingMore.js b/test/parallel/test-stream-readable-reading-readingMore.js index 2198a889f0584f..f5643205da0596 100644 --- a/test/parallel/test-stream-readable-reading-readingMore.js +++ b/test/parallel/test-stream-readable-reading-readingMore.js @@ -20,7 +20,7 @@ const Readable = require('stream').Readable; if (readable.readableFlowing) assert.strictEqual(state.readingMore, true); - // reading as long as we've not ended + // Reading as long as we've not ended assert.strictEqual(state.reading, !state.ended); }, 2)); @@ -78,7 +78,7 @@ const Readable = require('stream').Readable; if (readable.readableFlowing) assert.strictEqual(state.readingMore, true); - // reading as long as we've not ended + // Reading as long as we've not ended assert.strictEqual(state.reading, !state.ended); }, 2)); @@ -127,7 +127,7 @@ const Readable = require('stream').Readable; readable.on('readable', onReadable); readable.on('data', common.mustCall((data) => { - // reading as long as we've not ended + // Reading as long as we've not ended assert.strictEqual(state.reading, !state.ended); }, 2)); diff --git a/test/parallel/test-stream-transform-split-highwatermark.js b/test/parallel/test-stream-transform-split-highwatermark.js index 301d81bc904231..7837b009cd6a0e 100644 --- a/test/parallel/test-stream-transform-split-highwatermark.js +++ b/test/parallel/test-stream-transform-split-highwatermark.js @@ -39,7 +39,7 @@ testTransform(555, 555, { writableHighWaterMark: 777, }); -// test highWaterMark = 0 overriding +// Test highWaterMark = 0 overriding testTransform(0, 0, { highWaterMark: 0, readableHighWaterMark: 666, diff --git a/test/parallel/test-stream-writableState-ending.js b/test/parallel/test-stream-writableState-ending.js index ae2121f456eb4b..69afd1af5343dc 100644 --- a/test/parallel/test-stream-writableState-ending.js +++ b/test/parallel/test-stream-writableState-ending.js @@ -14,22 +14,22 @@ function testStates(ending, finished, ended) { } writable._write = (chunk, encoding, cb) => { - // ending, finished, ended start in false. + // Ending, finished, ended start in false. testStates(false, false, false); cb(); }; writable.on('finish', () => { - // ending, finished, ended = true. + // Ending, finished, ended = true. testStates(true, true, true); }); const result = writable.end('testing function end()', () => { - // ending, finished, ended = true. + // Ending, finished, ended = true. testStates(true, true, true); }); -// end returns the writable instance +// End returns the writable instance assert.strictEqual(result, writable); // ending, ended = true. diff --git a/test/parallel/test-stream-writableState-uncorked-bufferedRequestCount.js b/test/parallel/test-stream-writableState-uncorked-bufferedRequestCount.js index ca5d3dfb0f02bc..0cf9179ac49847 100644 --- a/test/parallel/test-stream-writableState-uncorked-bufferedRequestCount.js +++ b/test/parallel/test-stream-writableState-uncorked-bufferedRequestCount.js @@ -41,17 +41,17 @@ assert.strictEqual(writable._writableState.corked, 1); assert.strictEqual(writable._writableState.bufferedRequestCount, 2); function uncork() { - // second uncork flushes the buffer + // Second uncork flushes the buffer writable.uncork(); assert.strictEqual(writable._writableState.corked, 0); assert.strictEqual(writable._writableState.bufferedRequestCount, 0); - // verify that end() uncorks correctly + // Verify that end() uncorks correctly writable.cork(); writable.write('third chunk'); writable.end(); - // end causes an uncork() as well + // End causes an uncork() as well assert.strictEqual(writable._writableState.corked, 0); assert.strictEqual(writable._writableState.bufferedRequestCount, 0); } diff --git a/test/parallel/test-stream2-readable-from-list.js b/test/parallel/test-stream2-readable-from-list.js index 00024b91200fff..0210a1848df03a 100644 --- a/test/parallel/test-stream2-readable-from-list.js +++ b/test/parallel/test-stream2-readable-from-list.js @@ -52,15 +52,15 @@ function bufferListFromArray(arr) { } ]`); - // read more than the first element. + // Read more than the first element. let ret = fromList(6, { buffer: list, length: 16 }); assert.strictEqual(ret.toString(), 'foogba'); - // read exactly the first element. + // Read exactly the first element. ret = fromList(2, { buffer: list, length: 10 }); assert.strictEqual(ret.toString(), 'rk'); - // read less than the first element. + // Read less than the first element. ret = fromList(2, { buffer: list, length: 8 }); assert.strictEqual(ret.toString(), 'ba'); @@ -80,15 +80,15 @@ function bufferListFromArray(arr) { 'kuel' ]; list = bufferListFromArray(list); - // read more than the first element. + // Read more than the first element. let ret = fromList(6, { buffer: list, length: 16, decoder: true }); assert.strictEqual(ret, 'foogba'); - // read exactly the first element. + // Read exactly the first element. ret = fromList(2, { buffer: list, length: 10, decoder: true }); assert.strictEqual(ret, 'rk'); - // read less than the first element. + // Read less than the first element. ret = fromList(2, { buffer: list, length: 8, decoder: true }); assert.strictEqual(ret, 'ba'); diff --git a/test/parallel/test-stream2-set-encoding.js b/test/parallel/test-stream2-set-encoding.js index f60e8df9e15a85..0095fa544db114 100644 --- a/test/parallel/test-stream2-set-encoding.js +++ b/test/parallel/test-stream2-set-encoding.js @@ -34,14 +34,14 @@ class TestReader extends R { _read(n) { setTimeout(() => { if (this.pos >= this.len) { - // double push(null) to test eos handling + // Double push(null) to test eos handling this.push(null); return this.push(null); } n = Math.min(n, this.len - this.pos); if (n <= 0) { - // double push(null) to test eos handling + // Double push(null) to test eos handling this.push(null); return this.push(null); } diff --git a/test/parallel/test-stream2-transform.js b/test/parallel/test-stream2-transform.js index 92e4669dd4bc2c..cd6deaabf1147e 100644 --- a/test/parallel/test-stream2-transform.js +++ b/test/parallel/test-stream2-transform.js @@ -402,7 +402,7 @@ const Transform = require('_stream_transform'); } }; - // anything except null/undefined is fine. + // Anything except null/undefined is fine. // those are "magic" in the stream API, because they signal EOF. const objects = [ { foo: 'bar' }, @@ -443,7 +443,7 @@ const Transform = require('_stream_transform'); } }; - // anything except null/undefined is fine. + // Anything except null/undefined is fine. // those are "magic" in the stream API, because they signal EOF. const objects = [ { foo: 'bar' }, diff --git a/test/parallel/test-stream2-writable.js b/test/parallel/test-stream2-writable.js index ec8e088221277f..af38df7e684aac 100644 --- a/test/parallel/test-stream2-writable.js +++ b/test/parallel/test-stream2-writable.js @@ -34,7 +34,7 @@ class TestWriter extends W { } _write(chunk, encoding, cb) { - // simulate a small unpredictable latency + // Simulate a small unpredictable latency setTimeout(() => { this.buffer.push(chunk.toString()); this.written += chunk.length; @@ -73,7 +73,7 @@ for (let i = 0; i < chunks.length; i++) { }); tw.on('finish', common.mustCall(function() { - // got chunks in the right order + // Got chunks in the right order assert.deepStrictEqual(tw.buffer, chunks); })); diff --git a/test/parallel/test-stream3-cork-end.js b/test/parallel/test-stream3-cork-end.js index 8403e20fb1e8b2..0cbc033a2eadc4 100644 --- a/test/parallel/test-stream3-cork-end.js +++ b/test/parallel/test-stream3-cork-end.js @@ -17,17 +17,17 @@ let seenChunks = []; let seenEnd = false; const w = new Writable(); -// lets arrange to store the chunks +// Let's arrange to store the chunks. w._write = function(chunk, encoding, cb) { - // Stream end event is not seen before the last write + // Stream end event is not seen before the last write. assert.ok(!seenEnd); - // Default encoding given none was specified + // Default encoding given none was specified. assert.strictEqual(encoding, 'buffer'); seenChunks.push(chunk); cb(); }; -// lets record the stream end event +// Let's record the stream end event. w.on('finish', () => { seenEnd = true; }); @@ -39,7 +39,7 @@ function writeChunks(remainingChunks, callback) { if (writeChunk) { setImmediate(() => { writeState = w.write(writeChunk); - // we were not told to stop writing + // We were not told to stop writing. assert.ok(writeState); writeChunks(remainingChunks, callback); @@ -49,43 +49,43 @@ function writeChunks(remainingChunks, callback) { } } -// do an initial write +// Do an initial write. w.write('stuff'); -// the write was immediate +// The write was immediate. assert.strictEqual(seenChunks.length, 1); -// reset the seen chunks +// Reset the seen chunks. seenChunks = []; -// trigger stream buffering +// Trigger stream buffering. w.cork(); -// write the bufferedChunks +// Write the bufferedChunks. writeChunks(inputChunks, () => { - // should not have seen anything yet + // Should not have seen anything yet. assert.strictEqual(seenChunks.length, 0); - // trigger flush and ending the stream + // Trigger flush and ending the stream. w.end(); - // stream should not ended in current tick + // Stream should not ended in current tick. assert.ok(!seenEnd); - // Buffered bytes should be seen in current tick + // Buffered bytes should be seen in current tick. assert.strictEqual(seenChunks.length, 4); - // did the chunks match + // Did the chunks match. for (let i = 0, l = expectedChunks.length; i < l; i++) { const seen = seenChunks[i]; - // there was a chunk + // There was a chunk. assert.ok(seen); const expected = Buffer.from(expectedChunks[i]); - // it was what we expected + // It was what we expected. assert.ok(seen.equals(expected)); } setImmediate(() => { - // stream should have ended in next tick + // Stream should have ended in next tick. assert.ok(seenEnd); }); }); diff --git a/test/parallel/test-stream3-cork-uncork.js b/test/parallel/test-stream3-cork-uncork.js index 5b52ec0019feea..dfb901af419803 100644 --- a/test/parallel/test-stream3-cork-uncork.js +++ b/test/parallel/test-stream3-cork-uncork.js @@ -17,15 +17,15 @@ let seenChunks = []; let seenEnd = false; const w = new Writable(); -// lets arrange to store the chunks +// Let's arrange to store the chunks. w._write = function(chunk, encoding, cb) { - // Default encoding given none was specified + // Default encoding given none was specified. assert.strictEqual(encoding, 'buffer'); seenChunks.push(chunk); cb(); }; -// lets record the stream end event +// Let's record the stream end event. w.on('finish', () => { seenEnd = true; }); @@ -37,7 +37,7 @@ function writeChunks(remainingChunks, callback) { if (writeChunk) { setImmediate(() => { writeState = w.write(writeChunk); - // we were not told to stop writing + // We were not told to stop writing. assert.ok(writeState); writeChunks(remainingChunks, callback); @@ -47,40 +47,40 @@ function writeChunks(remainingChunks, callback) { } } -// do an initial write +// Do an initial write. w.write('stuff'); -// the write was immediate +// The write was immediate. assert.strictEqual(seenChunks.length, 1); -// reset the chunks seen so far +// Reset the chunks seen so far. seenChunks = []; -// trigger stream buffering +// Trigger stream buffering. w.cork(); -// write the bufferedChunks +// Write the bufferedChunks. writeChunks(inputChunks, () => { - // should not have seen anything yet + // Should not have seen anything yet. assert.strictEqual(seenChunks.length, 0); - // trigger writing out the buffer + // Trigger writing out the buffer. w.uncork(); - // Buffered bytes should be seen in current tick + // Buffered bytes should be seen in current tick. assert.strictEqual(seenChunks.length, 4); - // did the chunks match + // Did the chunks match. for (let i = 0, l = expectedChunks.length; i < l; i++) { const seen = seenChunks[i]; - // there was a chunk + // There was a chunk. assert.ok(seen); const expected = Buffer.from(expectedChunks[i]); - // it was what we expected + // It was what we expected. assert.ok(seen.equals(expected)); } setImmediate(() => { - // the stream should not have been ended + // The stream should not have been ended. assert.ok(!seenEnd); }); }); diff --git a/test/parallel/test-stream3-pause-then-read.js b/test/parallel/test-stream3-pause-then-read.js index d514c89e013327..b86c0157062dfe 100644 --- a/test/parallel/test-stream3-pause-then-read.js +++ b/test/parallel/test-stream3-pause-then-read.js @@ -77,7 +77,7 @@ function readn(n, then) { })(); } -// then we listen to some data events +// Then we listen to some data events function onData() { expectEndingData -= 100; console.error('onData'); diff --git a/test/parallel/test-string-decoder-end.js b/test/parallel/test-string-decoder-end.js index b10756a4633fca..0c0c072eb9d653 100644 --- a/test/parallel/test-string-decoder-end.js +++ b/test/parallel/test-string-decoder-end.js @@ -94,7 +94,7 @@ function testBuf(encoding, buf) { } res1 += s.end(); - // write the whole buffer at once. + // Write the whole buffer at once. let res2 = ''; s = new SD(encoding); res2 += s.write(buf); diff --git a/test/parallel/test-stringbytes-external.js b/test/parallel/test-stringbytes-external.js index 9d8aa45f67895e..b66fb0960adf21 100644 --- a/test/parallel/test-stringbytes-external.js +++ b/test/parallel/test-stringbytes-external.js @@ -67,10 +67,10 @@ assert.strictEqual(ucs2_control, l_bin); const b_bin = b.toString('binary'); assert.strictEqual(ucs2_control, b_bin); -// create buffer copy from external +// Create buffer copy from external const c_bin = Buffer.from(l_bin, 'latin1'); const c_ucs = Buffer.from(b_ucs, 'ucs2'); -// make sure they're the same length +// Make sure they're the same length assert.strictEqual(c_bin.length, c_ucs.length); // Make sure Buffers from externals are the same for (let i = 0; i < c_bin.length; i++) { @@ -101,7 +101,7 @@ const PRE_3OF4_APEX = Math.ceil((EXTERN_APEX / 4) * 3) - RADIOS; assert.strictEqual(pumped_string[k], pumped_string2[k]); } - // the recoded buffer is the same? + // The recoded buffer is the same? for (let i = 0; i < decoded.length; ++i) { assert.strictEqual(datum[i], decoded[i]); } @@ -122,7 +122,7 @@ const PRE_3OF4_APEX = Math.ceil((EXTERN_APEX / 4) * 3) - RADIOS; assert.strictEqual(pumped_string[k], pumped_string2[k]); } - // the recoded buffer is the same? + // The recoded buffer is the same? for (let i = 0; i < decoded.length; ++i) { assert.strictEqual(datum[i], decoded[i]); } diff --git a/test/parallel/test-timers-refresh.js b/test/parallel/test-timers-refresh.js index dd4332ab32ea70..597d5c9241947a 100644 --- a/test/parallel/test-timers-refresh.js +++ b/test/parallel/test-timers-refresh.js @@ -30,7 +30,7 @@ const { setUnrefTimeout } = require('internal/timers'); strictEqual(timer.refresh(), timer); } -// should throw with non-functions +// Should throw with non-functions { const expectedError = { code: 'ERR_INVALID_CALLBACK', diff --git a/test/parallel/test-timers-unrefed-in-callback.js b/test/parallel/test-timers-unrefed-in-callback.js index 50e6881bd3f60b..afeb3706df4ac9 100644 --- a/test/parallel/test-timers-unrefed-in-callback.js +++ b/test/parallel/test-timers-unrefed-in-callback.js @@ -24,7 +24,7 @@ let counter2 = 0; // it would have fired 11 more times, and the assertion in the // process'exit event handler would fail. function Test1() { - // server only for maintaining event loop + // Server only for maintaining event loop const server = net.createServer().listen(0); const timer1 = setInterval(common.mustCall(() => { @@ -43,7 +43,7 @@ function Test1() { // timer callback. counter2 continues to be incremented more than 11 // until server close completed. function Test2() { - // server only for maintaining event loop + // Server only for maintaining event loop const server = net.createServer().listen(0); const timer2 = setInterval(() => { diff --git a/test/parallel/test-timers.js b/test/parallel/test-timers.js index e29d756cfebd08..b8733f79f54639 100644 --- a/test/parallel/test-timers.js +++ b/test/parallel/test-timers.js @@ -60,7 +60,7 @@ inputs.forEach((value, index) => { }, value); const handle = setInterval(() => { - clearInterval(handle); // disarm timer or we'll never finish + clearInterval(handle); // Disarm timer or we'll never finish intervals[index] = true; }, value); }); @@ -69,7 +69,7 @@ inputs.forEach((value, index) => { // before a timer set here for 2 ms. setTimeout(common.mustCall(() => { - // assert that all other timers have run + // Assert that all other timers have run inputs.forEach((value, index) => { assert(timeouts[index]); assert(intervals[index]); diff --git a/test/parallel/test-tls-cipher-list.js b/test/parallel/test-tls-cipher-list.js index 4a39ee9391a7c1..ddbe6a33f6409d 100644 --- a/test/parallel/test-tls-cipher-list.js +++ b/test/parallel/test-tls-cipher-list.js @@ -23,8 +23,8 @@ function doCheck(arg, check) { }).on('error', common.mustNotCall()); } -// test the default unmodified version +// Test the default unmodified version doCheck([], defaultCoreList); -// test the command line switch by itself +// Test the command line switch by itself doCheck(['--tls-cipher-list=ABC'], 'ABC'); diff --git a/test/parallel/test-tls-env-extra-ca.js b/test/parallel/test-tls-env-extra-ca.js index b8ff1d3be237eb..c6587ae414e440 100644 --- a/test/parallel/test-tls-env-extra-ca.js +++ b/test/parallel/test-tls-env-extra-ca.js @@ -39,7 +39,7 @@ const server = tls.createServer(options, common.mustCall(function(s) { }); fork(__filename, { env }).on('exit', common.mustCall(function(status) { - // client did not succeed in connecting + // Client did not succeed in connecting assert.strictEqual(status, 0); })); })); diff --git a/test/parallel/test-tls-fast-writing.js b/test/parallel/test-tls-fast-writing.js index 937694228a5951..398beb0d097701 100644 --- a/test/parallel/test-tls-fast-writing.js +++ b/test/parallel/test-tls-fast-writing.js @@ -43,7 +43,7 @@ function onconnection(conn) { console.log('ok - got chunk'); } - // just some basic sanity checks. + // Just some basic sanity checks. assert(c.length); assert(Buffer.isBuffer(c)); @@ -69,7 +69,7 @@ server.listen(0, function() { write(); } function write() { - // this needs to return false eventually + // This needs to return false eventually while (false !== conn.write(chunk)); } }); diff --git a/test/parallel/test-url-fileurltopath.js b/test/parallel/test-url-fileurltopath.js index 9a9b751201766f..f6a1fb4fdafd01 100644 --- a/test/parallel/test-url-fileurltopath.js +++ b/test/parallel/test-url-fileurltopath.js @@ -93,7 +93,7 @@ assert.throws(() => url.fileURLToPath('https://a/b/c'), { { path: 'C:\\fóóbàr', fileURL: 'file:///C:/f%C3%B3%C3%B3b%C3%A0r' }, // euro sign (BMP code point) { path: 'C:\\€', fileURL: 'file:///C:/%E2%82%AC' }, - // rocket emoji (non-BMP code point) + // Rocket emoji (non-BMP code point) { path: 'C:\\🚀', fileURL: 'file:///C:/%F0%9F%9A%80' } ]; } else { @@ -138,7 +138,7 @@ assert.throws(() => url.fileURLToPath('https://a/b/c'), { { path: '/fóóbàr', fileURL: 'file:///f%C3%B3%C3%B3b%C3%A0r' }, // euro sign (BMP code point) { path: '/€', fileURL: 'file:///%E2%82%AC' }, - // rocket emoji (non-BMP code point) + // Rocket emoji (non-BMP code point) { path: '/🚀', fileURL: 'file:///%F0%9F%9A%80' }, ]; } diff --git a/test/parallel/test-url-pathtofileurl.js b/test/parallel/test-url-pathtofileurl.js index 6cdfa5dcd336ec..1beb69b7f38343 100644 --- a/test/parallel/test-url-pathtofileurl.js +++ b/test/parallel/test-url-pathtofileurl.js @@ -67,7 +67,7 @@ const url = require('url'); { path: 'C:\\fóóbàr', expected: 'file:///C:/f%C3%B3%C3%B3b%C3%A0r' }, // euro sign (BMP code point) { path: 'C:\\€', expected: 'file:///C:/%E2%82%AC' }, - // rocket emoji (non-BMP code point) + // Rocket emoji (non-BMP code point) { path: 'C:\\🚀', expected: 'file:///C:/%F0%9F%9A%80' } ]; } else { @@ -112,7 +112,7 @@ const url = require('url'); { path: '/fóóbàr', expected: 'file:///f%C3%B3%C3%B3b%C3%A0r' }, // euro sign (BMP code point) { path: '/€', expected: 'file:///%E2%82%AC' }, - // rocket emoji (non-BMP code point) + // Rocket emoji (non-BMP code point) { path: '/🚀', expected: 'file:///%F0%9F%9A%80' }, ]; } diff --git a/test/parallel/test-url-relative.js b/test/parallel/test-url-relative.js index 6bead6a30d7007..dc0362df1a5662 100644 --- a/test/parallel/test-url-relative.js +++ b/test/parallel/test-url-relative.js @@ -152,7 +152,7 @@ const relativeTests2 = [ ['g#s/../x', bases[0], 'http://a/b/c/g#s/../x'], ['http:g', bases[0], ('http:g', 'http://a/b/c/g')], ['http:', bases[0], ('http:', bases[0])], - // not sure where this one originated + // Not sure where this one originated ['/a/b/c/./../../g', bases[0], 'http://a/a/g'], // http://gbiv.com/protocols/uri/test/rel_examples2.html @@ -211,7 +211,7 @@ const relativeTests2 = [ ['../../', bases[3], 'fred:///s//'], ['../../g', bases[3], 'fred:///s//g'], ['../../../g', bases[3], 'fred:///s/g'], - // may change to fred:///s//a/../../../g + // May change to fred:///s//a/../../../g ['../../../../g', bases[3], 'fred:///g'], // http://gbiv.com/protocols/uri/test/rel_examples5.html @@ -229,9 +229,9 @@ const relativeTests2 = [ ['../g', bases[4], 'http:///s//a/g'], ['../../', bases[4], 'http:///s//'], ['../../g', bases[4], 'http:///s//g'], - // may change to http:///s//a/../../g + // May change to http:///s//a/../../g ['../../../g', bases[4], 'http:///s/g'], - // may change to http:///s//a/../../../g + // May change to http:///s//a/../../../g ['../../../../g', bases[4], 'http:///g'], // From Dan Connelly's tests in http://www.w3.org/2000/10/swap/uripath.py diff --git a/test/parallel/test-util-isDeepStrictEqual.js b/test/parallel/test-util-isDeepStrictEqual.js index 08a30a28dbc573..071e612565938a 100644 --- a/test/parallel/test-util-isDeepStrictEqual.js +++ b/test/parallel/test-util-isDeepStrictEqual.js @@ -350,7 +350,7 @@ notUtilIsDeepStrict( m2.set(2, 'hi'); // different order m2.set(1, obj); - m2.set(3, [1, 2, 3]); // deep equal, but not reference equal. + m2.set(3, [1, 2, 3]); // Deep equal, but not reference equal. utilIsDeepStrict(m1, m2); } diff --git a/test/parallel/test-v8-coverage.js b/test/parallel/test-v8-coverage.js index 926d28f14e1a7f..5c3db7af2cfea3 100644 --- a/test/parallel/test-v8-coverage.js +++ b/test/parallel/test-v8-coverage.js @@ -28,7 +28,7 @@ function nextdir() { assert.ok(fixtureCoverage); // first branch executed. assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); - // second branch did not execute. + // Second branch did not execute. assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); } @@ -44,7 +44,7 @@ function nextdir() { assert.ok(fixtureCoverage, 'coverage not found for file'); // first branch executed. assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); - // second branch did not execute. + // Second branch did not execute. assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); } @@ -62,11 +62,11 @@ function nextdir() { assert.ok(fixtureCoverage); // first branch executed. assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); - // second branch did not execute. + // Second branch did not execute. assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); } -// outputs coverage from subprocess. +// Outputs coverage from subprocess. { const coverageDirectory = path.join(tmpdir.path, nextdir()); const output = spawnSync(process.execPath, [ @@ -79,7 +79,7 @@ function nextdir() { assert.ok(fixtureCoverage); // first branch executed. assert.strictEqual(fixtureCoverage.functions[1].ranges[0].count, 1); - // second branch did not execute. + // Second branch did not execute. assert.strictEqual(fixtureCoverage.functions[1].ranges[1].count, 0); } @@ -96,7 +96,7 @@ function nextdir() { assert.ok(fixtureCoverage); // first branch executed. assert.strictEqual(fixtureCoverage.functions[1].ranges[0].count, 1); - // second branch did not execute. + // Second branch did not execute. assert.strictEqual(fixtureCoverage.functions[1].ranges[1].count, 0); } @@ -145,7 +145,7 @@ function nextdir() { assert.ok(fixtureCoverage); // first branch executed. assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); - // second branch did not execute. + // Second branch did not execute. assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); } diff --git a/test/parallel/test-vm-global-property-interceptors.js b/test/parallel/test-vm-global-property-interceptors.js index 8fe5f8f3da91b2..23c56018b62e1f 100644 --- a/test/parallel/test-vm-global-property-interceptors.js +++ b/test/parallel/test-vm-global-property-interceptors.js @@ -117,7 +117,7 @@ Object.defineProperty(this, 'encodeURI', { value: 42 }); assert.strictEqual(vm.runInContext('encodeURI;', ctx), 42); assert.strictEqual(ctx.encodeURI, 42); -// redefine properties on the sandbox +// Redefine properties on the sandbox vm.runInContext(` Object.defineProperty(this, 'e', { value: 'newE' }); `, ctx); diff --git a/test/parallel/test-zlib-from-concatenated-gzip.js b/test/parallel/test-zlib-from-concatenated-gzip.js index 45f8281387ceb4..7bb31c0f9ddd9f 100644 --- a/test/parallel/test-zlib-from-concatenated-gzip.js +++ b/test/parallel/test-zlib-from-concatenated-gzip.js @@ -81,6 +81,6 @@ fs.createReadStream(pmmFileGz) abcEncoded, defEncoded.slice(0, offset) ])); - // write remaining bytes of "def" + // Write remaining bytes of "def" unzip.end(defEncoded.slice(offset)); }); diff --git a/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js b/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js index f7b09f7ec03fca..7db3a8a27abad5 100644 --- a/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js +++ b/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js @@ -5,7 +5,7 @@ const common = require('../common'); const assert = require('assert'); const zlib = require('zlib'); -// should ignore trailing null-bytes +// Should ignore trailing null-bytes let data = Buffer.concat([ zlib.gzipSync('abc'), zlib.gzipSync('def'), diff --git a/test/parallel/test-zlib-invalid-input.js b/test/parallel/test-zlib-invalid-input.js index dbfb5235b8a908..9b22df477840cb 100644 --- a/test/parallel/test-zlib-invalid-input.js +++ b/test/parallel/test-zlib-invalid-input.js @@ -20,7 +20,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; -// test uncompressing invalid input +// Test uncompressing invalid input const common = require('../common'); const assert = require('assert'); diff --git a/test/parallel/test-zlib-random-byte-pipes.js b/test/parallel/test-zlib-random-byte-pipes.js index c7026163e77586..0816e047bb0eef 100644 --- a/test/parallel/test-zlib-random-byte-pipes.js +++ b/test/parallel/test-zlib-random-byte-pipes.js @@ -31,7 +31,7 @@ const zlib = require('zlib'); const Stream = stream.Stream; -// emit random bytes, and keep a shasum +// Emit random bytes, and keep a shasum class RandomReadStream extends Stream { constructor(opt) { super(); @@ -50,7 +50,7 @@ class RandomReadStream extends Stream { opt.total = opt.total || 256 * 1024 * 1024; this._remaining = opt.total; - // how variable to make the block sizes + // How variable to make the block sizes opt.jitter = opt.jitter || 1024; this._opt = opt; @@ -86,7 +86,7 @@ class RandomReadStream extends Stream { return; } - // figure out how many bytes to output + // Figure out how many bytes to output // if finished, then just emit end. let block = this._opt.block; const jitter = this._opt.jitter; @@ -110,7 +110,7 @@ class RandomReadStream extends Stream { } } -// a filter that just verifies a shasum +// A filter that just verifies a shasum class HashStream extends Stream { constructor() { super(); diff --git a/test/parallel/test-zlib.js b/test/parallel/test-zlib.js index d5ef9fe9d13ce7..1852ae33936452 100644 --- a/test/parallel/test-zlib.js +++ b/test/parallel/test-zlib.js @@ -39,7 +39,7 @@ let zlibPairs = [ // How fast to trickle through the slowstream let trickle = [128, 1024, 1024 * 1024]; -// tunable options for zlib classes. +// Tunable options for zlib classes. // several different chunk sizes let chunkSize = [128, 1024, 1024 * 16, 1024 * 1024]; @@ -144,7 +144,7 @@ class SlowStream extends stream.Stream { } end(chunk) { - // walk over the chunk in blocks. + // Walk over the chunk in blocks. this.chunk = chunk; this.length = chunk.length; this.resume(); diff --git a/test/pummel/test-net-timeout.js b/test/pummel/test-net-timeout.js index 524322440a1ea6..59a8d50f796d64 100644 --- a/test/pummel/test-net-timeout.js +++ b/test/pummel/test-net-timeout.js @@ -59,7 +59,7 @@ echo_server.listen(common.PORT, () => { const client = net.createConnection(common.PORT); client.setEncoding('UTF8'); - client.setTimeout(0); // disable the timeout for client + client.setTimeout(0); // Disable the timeout for client client.on('connect', () => { console.log('client connected.'); client.write('hello\r\n'); diff --git a/test/pummel/test-stream-pipe-multi.js b/test/pummel/test-stream-pipe-multi.js index 2767028c4b393b..f8fb7c9cc89cc2 100644 --- a/test/pummel/test-stream-pipe-multi.js +++ b/test/pummel/test-stream-pipe-multi.js @@ -64,7 +64,7 @@ FakeStream.prototype.close = function() { }; -// expect all streams to close properly. +// Expect all streams to close properly. process.on('exit', function() { assert.strictEqual(wclosed, cnt); assert.strictEqual(rclosed, cnt); @@ -93,8 +93,8 @@ for (let i = 0; i < cnt; i++) { r.pipe(w); } -// now start passing through data -// simulate a relatively fast async stream. +// Now start passing through data. +// Simulate a relatively fast async stream. rr.forEach(function(r) { let cnt = chunks; let paused = false; diff --git a/test/pummel/test-timers.js b/test/pummel/test-timers.js index 6b761f455de20e..8a8646b3237f90 100644 --- a/test/pummel/test-timers.js +++ b/test/pummel/test-timers.js @@ -23,11 +23,11 @@ const common = require('../common'); const assert = require('assert'); -const WINDOW = 200; // why is does this need to be so big? +const WINDOW = 200; // Why is does this need to be so big? let interval_count = 0; -// check that these don't blow up. +// Check that these don't blow up. clearTimeout(null); clearInterval(null); diff --git a/test/sequential/test-debugger-debug-brk.js b/test/sequential/test-debugger-debug-brk.js index 65ee43061cb40c..d8c5c67c0204c9 100644 --- a/test/sequential/test-debugger-debug-brk.js +++ b/test/sequential/test-debugger-debug-brk.js @@ -19,7 +19,7 @@ function test(arg) { const fail = () => assert.fail(true, false, `'${argStr}' should not quit`); child.on('exit', fail); - // give node time to start up the debugger + // Give node time to start up the debugger setTimeout(function() { child.removeListener('exit', fail); child.kill(); diff --git a/test/sequential/test-deprecation-flags.js b/test/sequential/test-deprecation-flags.js index be159ceb384ee2..1c369a0f8b361c 100644 --- a/test/sequential/test-deprecation-flags.js +++ b/test/sequential/test-deprecation-flags.js @@ -61,7 +61,7 @@ execFile(node, traceDep, function(er, stdout, stderr) { assert.strictEqual(er, null); assert.strictEqual(stdout, ''); const stack = stderr.trim().split('\n'); - // just check the top and bottom. + // Just check the top and bottom. assert( /util\.debug is deprecated\. Use console\.error instead\./.test(stack[1]) ); diff --git a/test/sequential/test-http-max-http-headers.js b/test/sequential/test-http-max-http-headers.js index b91135a61a2a5a..16704fd9124c3e 100644 --- a/test/sequential/test-http-max-http-headers.js +++ b/test/sequential/test-http-max-http-headers.js @@ -59,7 +59,7 @@ function writeHeaders(socket, headers) { last = current; } - // safety check we are chunking correctly + // Safety check we are chunking correctly assert.strictEqual(array.join(''), headers); next(); diff --git a/test/sequential/test-inspector.js b/test/sequential/test-inspector.js index 9aaabdc6c95472..04381918583bc9 100644 --- a/test/sequential/test-inspector.js +++ b/test/sequential/test-inspector.js @@ -225,7 +225,7 @@ async function testCommandLineAPI(session) { checkException(result); assert.deepStrictEqual(JSON.parse(result.result.value), { old: 'yes' }); - // remove module from require.cache + // Remove module from require.cache result = await session.send( { 'method': 'Runtime.evaluate', 'params': { diff --git a/test/sequential/test-module-loading.js b/test/sequential/test-module-loading.js index 9c60d15d9e93da..db9d7e9d40ec9a 100644 --- a/test/sequential/test-module-loading.js +++ b/test/sequential/test-module-loading.js @@ -45,7 +45,7 @@ require('../fixtures/not-main-module.js'); } { - // require a file without any extensions + // Require a file without any extensions const foo_no_ext = require('../fixtures/foo'); assert.strictEqual(foo_no_ext.foo, 'ok'); } @@ -154,7 +154,7 @@ require.extensions['.test'] = function(module, filename) { }; assert.strictEqual(require('../fixtures/registerExt').test, 'passed'); -// unknown extension, load as .js +// Unknown extension, load as .js assert.strictEqual(require('../fixtures/registerExt.hello.world').test, 'passed'); diff --git a/test/sequential/test-net-listen-shared-ports.js b/test/sequential/test-net-listen-shared-ports.js index 78d94b4ae1e6b0..41345f37e66b6c 100644 --- a/test/sequential/test-net-listen-shared-ports.js +++ b/test/sequential/test-net-listen-shared-ports.js @@ -59,7 +59,7 @@ if (cluster.isMaster) { }, common.mustCall(function() { server2.listen({ port: common.PORT + 1, exclusive: true }, common.mustCall(function() { - // the first worker should succeed + // The first worker should succeed process.send('success'); }) ); diff --git a/test/sequential/test-repl-timeout-throw.js b/test/sequential/test-repl-timeout-throw.js index 3636b93ddfc2b2..eecd7b39867104 100644 --- a/test/sequential/test-repl-timeout-throw.js +++ b/test/sequential/test-repl-timeout-throw.js @@ -53,7 +53,7 @@ child.stdout.once('data', function() { child.on('close', function(c) { assert.strictEqual(c, 0); - // make sure we got 3 throws, in the end. + // Make sure we got 3 throws, in the end. const lastLine = stdout.trim().split(/\r?\n/).pop(); assert.strictEqual(lastLine, '> 3'); }); diff --git a/tools/doc/html.js b/tools/doc/html.js index ef15cbded87f6a..4d5e31fe9c79bb 100644 --- a/tools/doc/html.js +++ b/tools/doc/html.js @@ -221,7 +221,7 @@ function preprocessElements({ filename }) { node.children.shift(); node.children.unshift(...paragraph.children); - // insert div with prefix and number + // Insert div with prefix and number node.children.unshift({ type: 'html', value: `
` + @@ -231,7 +231,7 @@ function preprocessElements({ filename }) { .replace(/\n/g, ' ') }); - // remove prefix and number from text + // Remove prefix and number from text text.value = explication; // close div