diff --git a/.eslintignore b/.eslintignore
index 80959ce611ee58..bdfdfaeab2388d 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,9 +1,7 @@
node_modules
-lib/internal/v8.js
lib/internal/v8_prof_polyfill.js
lib/punycode.js
test/addons/??_*
-test/es-module/test-esm-dynamic-import.js
test/fixtures
test/message/esm_display_syntax_error.mjs
tools/icu
diff --git a/.eslintrc.js b/.eslintrc.js
index 23ddc3c95cd39d..6dda76cb4ea985 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -58,6 +58,18 @@ module.exports = {
'arrow-spacing': ['error', { before: true, after: true }],
'block-spacing': 'error',
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
+ 'capitalized-comments': ['error', 'always', {
+ line: {
+ // Ignore all lines that have less characters than 62 and all lines that
+ // start with something that looks like a variable name or code.
+ ignorePattern: '^.{0,62}$|^ [a-z]+ ?[0-9A-Z_.(/=:-]',
+ ignoreInlineComments: true,
+ ignoreConsecutiveComments: true
+ },
+ block: {
+ ignorePattern: '.*'
+ }
+ }],
'comma-dangle': ['error', 'only-multiline'],
'comma-spacing': 'error',
'comma-style': 'error',
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ec9307646c0bc2..29a5158bd74fc6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,7 +28,8 @@ release.
-11.4.0
+11.5.0
+11.4.0
11.3.0
11.2.0
11.1.0
diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md
index d270903c2eadc3..193591381a108a 100644
--- a/COLLABORATOR_GUIDE.md
+++ b/COLLABORATOR_GUIDE.md
@@ -72,8 +72,7 @@ issues and pull requests can always be re-opened if necessary.
A pull request is _author ready_ when:
* There is a CI run in progress or completed.
-* There are at least two Collaborator approvals, or at least one approval if the
- pull request is older than 7 days.
+* There is at least one Collaborator approval.
* There are no outstanding review comments.
Please always add the `author ready` label to the pull request in that case.
@@ -147,56 +146,54 @@ the TSC meeting agenda.
### Waiting for Approvals
-Before landing pull requests, sufficient time should be left for input
-from other Collaborators. In general, leave at least 48 hours to account for
-international time differences and work schedules. However, certain types of
-pull requests can be fast-tracked and may be landed after a shorter delay. For
-example:
+Before landing pull requests, allow 48 hours for input from other Collaborators.
+Certain types of pull requests can be fast-tracked and may land after a shorter
+delay. For example:
* Focused changes that affect only documentation and/or the test suite:
- * `code-and-learn` tasks typically fall into this category.
+ * `code-and-learn` tasks often fall into this category.
* `good-first-issue` pull requests may also be suitable.
* Changes that fix regressions:
* Regressions that break the workflow (red CI or broken compilation).
* Regressions that happen right before a release, or reported soon after.
-When a pull request is deemed suitable to be fast-tracked, label it with
-`fast-track` and add a comment that collaborators may upvote. Please mention any
-Collaborators that previously approved the pull request. If someone disagrees
-with the fast-tracking request, remove the label and leave a comment indicating
-why the pull request should not be fast-tracked. The pull request can be landed
-once two or more Collaborators approve both the pull request and the
-fast-tracking request, and the necessary CI testing is done. A request to
-fast-track a PR made by a different Collaborator than the pull-request author
-counts as a fast-track approval.
+To propose fast-tracking a pull request, apply the `fast-track` label. Then add
+a comment that Collaborators may upvote.
+
+If someone disagrees with the fast-tracking request, remove the label. Do not
+fast-track the pull request in that case.
+
+The pull request may be fast-tracked if two Collaborators approve the
+fast-tracking request. To land, the pull request itself still needs two
+Collaborator approvals and a passing CI.
+
+Collaborators may request fast-tracking of pull requests they did not author.
+In that case only, the request itself is also one fast-track approval. Upvote
+the comment anyway to avoid any doubt.
### Testing and CI
-All bugfixes require a test case which demonstrates the defect. The
-test should *fail* before the change, and *pass* after the change.
+All fixes must have a test case which demonstrates the defect. The test should
+fail before the change, and pass after the change.
-All pull requests that modify executable code should also include a test case
-and must be subjected to continuous integration tests on the
-[project CI server](https://ci.nodejs.org/). The pull request should have a CI
-status indicator.
+All pull requests must pass continuous integration tests on the
+[project CI server](https://ci.nodejs.org/).
-Do not land any Pull Requests without passing (green or yellow) CI runs. If you
-believe any failed (red or grey) CI sub-tasks are unrelated to the change in the
-Pull Request, use "Resume Build" in the left navigation of the relevant
-`node-test-pull-request` job. It will create a new `node-test-pull-request` run
-that preserves all the green results from the current job but re-runs everything
-else.
+Do not land any pull requests without passing (green or yellow) CI runs. If
+there are CI failures unrelated to the change in the pull request, try "Resume
+Build". It is in the left navigation of the relevant `node-test-pull-request`
+job. It will preserve all the green results from the current job but re-run
+everything else.
#### Useful CI Jobs
* [`node-test-pull-request`](https://ci.nodejs.org/job/node-test-pull-request/)
-is the standard CI run we do to check Pull Requests. It triggers
-`node-test-commit`, which runs the `build-ci` and `test-ci` targets on all
-supported platforms.
+is the CI job to test pull requests. It runs the `build-ci` and `test-ci`
+targets on all supported platforms.
* [`node-test-pull-request-lite-pipeline`](https://ci.nodejs.org/job/node-test-pull-request-lite-pipeline/)
-only runs the linter job, as well as the tests on LinuxONE, which is very fast.
-This is useful for changes that only affect comments or documentation.
+runs the linter job. It also runs the tests on a very fast host. This is useful
+for changes that only affect comments or documentation.
* [`citgm-smoker`](https://ci.nodejs.org/job/citgm-smoker/)
uses [`CitGM`](https://github.com/nodejs/citgm) to allow you to run
@@ -205,69 +202,43 @@ useful to check whether a change will cause breakage in the ecosystem. To test
Node.js ABI changes you can run [`citgm-abi-smoker`](https://ci.nodejs.org/job/citgm-abi-smoker/).
* [`node-stress-single-test`](https://ci.nodejs.org/job/node-stress-single-test/)
-is designed to allow one to run a group of tests over and over on a specific
-platform to confirm that the test is reliable.
+can run a group of tests over and over on a specific platform. Use it to check
+that the tests are reliable.
* [`node-test-commit-v8-linux`](https://ci.nodejs.org/job/node-test-commit-v8-linux/)
-is designed to allow validation of changes to the copy of V8 in the Node.js
-tree by running the standard V8 tests. It should be run whenever the
-level of V8 within Node.js is updated or new patches are floated on V8.
+runs the standard V8 tests. Run it when updating V8 in Node.js or floating new
+patches on V8.
* [`node-test-commit-custom-suites`](https://ci.nodejs.org/job/node-test-commit-custom-suites/)
-can be used to customize what tests are run and with what parameters. For
-example, it can be used to execute tests which are not executed in a typical
-`node-test-commit` run (such as tests in the `internet` or `pummel`
-directories). It can also be used to make sure tests pass when provided with a
-flag not typically used in other CI test runs (such as `--worker`).
+enables customization of test suites and parameters. It can execute test suites
+not used in other CI test runs (such as tests in the `internet` or `pummel`
+directories). It can also make sure tests pass when provided with a flag not
+used in other CI test runs (such as `--worker`).
### Internal vs. Public API
-Due to the nature of the JavaScript language, it can often be difficult to
-establish a clear distinction between which parts of the Node.js implementation
-represent the public API Node.js users should assume to be stable and which
-are part of the internal implementation details of Node.js itself. A rule of
-thumb is to base the determination off what functionality is actually
-documented in the official Node.js API documentation. However, it has been
-repeatedly demonstrated that either the documentation does not completely cover
-implemented behavior or that Node.js users have come to rely heavily on
-undocumented aspects of the Node.js implementation.
-
-The following general rules should be followed to determine which aspects of the
-Node.js API are internal:
-
-- All functionality exposed via `process.binding(...)` is internal.
-- All functionality implemented in `lib/internal/**/*.js` is internal unless it
- is re-exported by code in `lib/*.js` or documented as part of the Node.js
- Public API.
-- Any object property or method whose key is a non-exported `Symbol` is an
- internal property.
-- Any object property or method whose key begins with the underscore `_` prefix
- is internal unless it is documented as part of the Node.js Public API.
-- Any object, property, method, argument, behavior, or event not documented in
- the Node.js documentation is internal.
-- Any native C/C++ APIs/ABIs exported by the Node.js `*.h` header files that
- are hidden behind the `NODE_WANT_INTERNALS` flag are internal.
-
-Exceptions can be made if use or behavior of a given internal API can be
-demonstrated to be sufficiently relied upon by the Node.js ecosystem such that
-any changes would cause too much breakage. The threshold for what qualifies as
-too much breakage is to be decided on a case-by-case basis by the TSC.
-
-If it is determined that a currently undocumented object, property, method,
-argument, or event *should* be documented, then a pull request adding the
-documentation is required in order for it to be considered part of the public
-API.
-
-Making a determination about whether something *should* be documented can be
-difficult and will need to be handled on a case-by-case basis. For instance, if
-one documented API cannot be used successfully without the use of a second
-*currently undocumented* API, then the second API *should* be documented. If
-using an API in a manner currently undocumented achieves a particular useful
-result, a decision will need to be made whether or not that falls within the
-supported scope of that API; and if it does, it should be documented.
-
-See [Breaking Changes to Internal Elements](#breaking-changes-to-internal-elements)
-on how to handle those types of changes.
+All functionality in the official Node.js documentation is part of the public
+API. Any undocumented object, property, method, argument, behavior, or event is
+internal. There are exceptions to this rule. Node.js users have come to rely on
+some undocumented behaviors. Collaborators treat many of those undocumented
+behaviors as public.
+
+All undocumented functionality exposed via `process.binding(...)` is internal.
+
+All undocumented functionality in `lib/internal/**/*.js` is internal. It is
+public, though, if it is re-exported by code in `lib/*.js`.
+
+Non-exported `Symbol` properties and methods are internal.
+
+Any undocumented object property or method that begins with `_` is internal.
+
+Any native C/C++ APIs/ABIs requiring the `NODE_WANT_INTERNALS` flag are
+internal.
+
+Sometimes, there is disagreement about whether functionality is internal or
+public. In those cases, the TSC makes a determination.
+
+For undocumented APIs that are public, open a pull request documenting the API.
### Breaking Changes
diff --git a/LICENSE b/LICENSE
index 59958b20e24a06..acb8712a8f7e29 100644
--- a/LICENSE
+++ b/LICENSE
@@ -76,7 +76,7 @@ The externally maintained libraries used by Node.js are:
- c-ares, located at deps/cares, is licensed as follows:
"""
- Copyright (c) 2007 - 2016, Daniel Stenberg with many contributors, see AUTHORS
+ Copyright (c) 2007 - 2018, Daniel Stenberg with many contributors, see AUTHORS
file.
Copyright 1998 by the Massachusetts Institute of Technology.
diff --git a/Makefile b/Makefile
index 6dfc1de6af5833..3cbf6118a91e96 100644
--- a/Makefile
+++ b/Makefile
@@ -1263,10 +1263,14 @@ tools/.cpplintstamp: $(LINT_CPP_FILES)
@$(PYTHON) tools/check-imports.py
@touch $@
-lint-addon-docs: test/addons/.docbuildstamp
+.PHONY: lint-addon-docs
+lint-addon-docs: tools/.doclintstamp
+
+tools/.doclintstamp: test/addons/.docbuildstamp
@echo "Running C++ linter on addon docs..."
@$(PYTHON) tools/cpplint.py $(CPPLINT_QUIET) --filter=$(ADDON_DOC_LINT_FLAGS) \
$(LINT_CPP_ADDON_DOC_FILES_GLOB)
+ @touch $@
cpplint: lint-cpp
@echo "Please use lint-cpp instead of cpplint"
@@ -1286,7 +1290,7 @@ ifneq ("","$(wildcard tools/pip/site-packages)")
lint-py:
PYTHONPATH=tools/pip $(PYTHON) -m flake8 . \
--count --show-source --statistics --select=E901,E999,F821,F822,F823 \
- --exclude=.git,deps,lib,src,tools/*_macros.py,tools/gyp,tools/jinja2,tools/pip
+ --exclude=.git,deps,lib,src,tools/*_macros.py,tools/gyp,tools/inspector_protocol,tools/jinja2,tools/markupsafe,tools/pip
else
lint-py:
@echo "Python linting with flake8 is not avalible"
diff --git a/README.md b/README.md
index 1835c51cc6e252..34d65f8f1f7a41 100644
--- a/README.md
+++ b/README.md
@@ -50,11 +50,10 @@ If you didn't find an answer in the resources above, try these unofficial
resources:
* [Questions tagged 'node.js' on StackOverflow][]
-* [#node.js channel on chat.freenode.net][]. See for more
- information.
+* [#node.js channel on chat.freenode.net][]
* [Node.js Discord Community](https://discordapp.com/invite/v7rrPdE)
-* [Node.js Slack Community](https://node-js.slack.com/): Visit
- [nodeslackers.com](http://www.nodeslackers.com/) to register.
+* [Node.js Slack Community](https://node-js.slack.com/)
+ * To register: [nodeslackers.com](http://www.nodeslackers.com/)
GitHub issues are for tracking enhancements and bugs, not general support.
@@ -552,11 +551,14 @@ GPG keys used to sign Node.js releases:
`DD8F2338BAE7501E3DD5AC78C273792F7D83545D`
* **Ruben Bridgewater** <ruben@bridgewater.de>
`A48C2BEE680E841632CD4E44F07496B3EB3C1762`
+* **Shelley Vohr** <shelley.vohr@gmail.com>
+`B9E2F5981AA6E0CD28160D9FF13993A75599653C`
To import the full set of trusted release keys:
```shell
gpg --keyserver pool.sks-keyservers.net --recv-keys 4ED778F539E3634C779C87C6D7062848A1AB005C
+gpg --keyserver pool.sks-keyservers.net --recv-keys B9E2F5981AA6E0CD28160D9FF13993A75599653C
gpg --keyserver pool.sks-keyservers.net --recv-keys 94AE36675C464D64BAFA68DD7434390BDBE9B9C5
gpg --keyserver pool.sks-keyservers.net --recv-keys B9AE9905FFD7803F25714661B63B535A4C206CA9
gpg --keyserver pool.sks-keyservers.net --recv-keys 77984A986EBC2AA786BC0F66B01FBB92821C587A
diff --git a/benchmark/_cli.js b/benchmark/_cli.js
index 4d92b05b1b82b4..0c39c0b1931f48 100644
--- a/benchmark/_cli.js
+++ b/benchmark/_cli.js
@@ -49,7 +49,7 @@ function CLI(usage, settings) {
this.optional[currentOptional] = true;
mode = 'both';
} else {
- // expect the next value to be option related (either -- or the value)
+ // Expect the next value to be option related (either -- or the value)
mode = 'option';
}
} else if (mode === 'option') {
diff --git a/benchmark/child_process/child-process-exec-stdout.js b/benchmark/child_process/child-process-exec-stdout.js
index 88c02533f605c2..a1dc4aa04c72a9 100644
--- a/benchmark/child_process/child-process-exec-stdout.js
+++ b/benchmark/child_process/child-process-exec-stdout.js
@@ -31,7 +31,7 @@ function childProcessExecStdout({ dur, len }) {
try {
execSync(`taskkill /f /t /pid ${child.pid}`);
} catch {
- // this is a best effort kill. stderr is piped to parent for tracing.
+ // This is a best effort kill. stderr is piped to parent for tracing.
}
} else {
child.kill();
diff --git a/benchmark/common.js b/benchmark/common.js
index d5e0494c16e826..521a145997a8a4 100644
--- a/benchmark/common.js
+++ b/benchmark/common.js
@@ -146,7 +146,7 @@ Benchmark.prototype._run = function() {
(function recursive(queueIndex) {
const config = self.queue[queueIndex];
- // set NODE_RUN_BENCHMARK_FN to indicate that the child shouldn't construct
+ // Set NODE_RUN_BENCHMARK_FN to indicate that the child shouldn't construct
// a configuration queue, but just execute the benchmark function.
const childEnv = Object.assign({}, process.env);
childEnv.NODE_RUN_BENCHMARK_FN = '';
@@ -187,7 +187,7 @@ Benchmark.prototype.start = function() {
};
Benchmark.prototype.end = function(operations) {
- // get elapsed time now and do error checking later for accuracy.
+ // Get elapsed time now and do error checking later for accuracy.
const elapsed = process.hrtime(this._time);
if (!this._started) {
diff --git a/benchmark/crypto/cipher-stream.js b/benchmark/crypto/cipher-stream.js
index 9f986dfb36b60d..c9989d32dcd20a 100644
--- a/benchmark/crypto/cipher-stream.js
+++ b/benchmark/crypto/cipher-stream.js
@@ -58,7 +58,7 @@ function main({ api, cipher, type, len, writes }) {
const fn = api === 'stream' ? streamWrite : legacyWrite;
- // write data as fast as possible to alice, and have bob decrypt.
+ // Write data as fast as possible to alice, and have bob decrypt.
// use old API for comparison to v0.8
bench.start();
fn(alice_cipher, bob_cipher, message, encoding, writes);
diff --git a/benchmark/dgram/array-vs-concat.js b/benchmark/dgram/array-vs-concat.js
index a7843a9c7f7c28..c73c9538589540 100644
--- a/benchmark/dgram/array-vs-concat.js
+++ b/benchmark/dgram/array-vs-concat.js
@@ -1,4 +1,4 @@
-// test UDP send throughput with the multi buffer API against Buffer.concat
+// Test UDP send throughput with the multi buffer API against Buffer.concat
'use strict';
const common = require('../common.js');
diff --git a/benchmark/dgram/offset-length.js b/benchmark/dgram/offset-length.js
index 8a2df9ac67c1b6..7c78765cee0d09 100644
--- a/benchmark/dgram/offset-length.js
+++ b/benchmark/dgram/offset-length.js
@@ -1,4 +1,4 @@
-// test UDP send/recv throughput with the "old" offset/length API
+// Test UDP send/recv throughput with the "old" offset/length API
'use strict';
const common = require('../common.js');
diff --git a/benchmark/napi/function_call/index.js b/benchmark/napi/function_call/index.js
index 59063e500f7a84..e7d9fe46e54636 100644
--- a/benchmark/napi/function_call/index.js
+++ b/benchmark/napi/function_call/index.js
@@ -7,7 +7,7 @@
const assert = require('assert');
const common = require('../../common.js');
-// this fails when we try to open with a different version of node,
+// This fails when we try to open with a different version of node,
// which is quite common for benchmarks. so in that case, just
// abort quietly.
diff --git a/benchmark/net/net-wrap-js-stream-passthrough.js b/benchmark/net/net-wrap-js-stream-passthrough.js
index c4d11fa56c7411..0e76281b25e927 100644
--- a/benchmark/net/net-wrap-js-stream-passthrough.js
+++ b/benchmark/net/net-wrap-js-stream-passthrough.js
@@ -1,4 +1,4 @@
-// test the speed of .pipe() with JSStream wrapping for PassThrough streams
+// Test the speed of .pipe() with JSStream wrapping for PassThrough streams
'use strict';
const common = require('../common.js');
diff --git a/configure.py b/configure.py
index 1bef01baef5fbc..ca870824248532 100755
--- a/configure.py
+++ b/configure.py
@@ -655,8 +655,8 @@ def try_check_compiler(cc, lang):
values = (proc.communicate()[0].split() + ['0'] * 7)[0:7]
is_clang = values[0] == '1'
- gcc_version = tuple(values[1:1+3])
- clang_version = tuple(values[4:4+3])
+ gcc_version = tuple(map(int, values[1:1+3]))
+ clang_version = tuple(map(int, values[4:4+3])) if is_clang else None
return (True, is_clang, clang_version, gcc_version)
@@ -753,6 +753,8 @@ def check_compiler(o):
ok, is_clang, clang_version, gcc_version = try_check_compiler(CXX, 'c++')
if not ok:
warn('failed to autodetect C++ compiler version (CXX=%s)' % CXX)
+ elif sys.platform.startswith('aix') and gcc_version < (6, 3, 0):
+ warn('C++ compiler too old, need g++ 6.3.0 (CXX=%s)' % CXX)
elif clang_version < (3, 4, 2) if is_clang else gcc_version < (4, 9, 4):
warn('C++ compiler too old, need g++ 4.9.4 or clang++ 3.4.2 (CXX=%s)' % CXX)
@@ -921,8 +923,7 @@ def gcc_version_ge(version_checked):
for compiler in [(CC, 'c'), (CXX, 'c++')]:
ok, is_clang, clang_version, compiler_version = \
try_check_compiler(compiler[0], compiler[1])
- compiler_version_num = tuple(map(int, compiler_version))
- if is_clang or compiler_version_num < version_checked:
+ if is_clang or compiler_version < version_checked:
return False
return True
diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md
index ad7a94736ff540..587a74c3d06caa 100644
--- a/doc/api/async_hooks.md
+++ b/doc/api/async_hooks.md
@@ -61,12 +61,12 @@ asyncHook.disable();
// resource referenced by "asyncId" may not have been populated.
function init(asyncId, type, triggerAsyncId, resource) { }
-// before is called just before the resource's callback is called. It can be
+// Before is called just before the resource's callback is called. It can be
// called 0-N times for handles (e.g. TCPWrap), and will be called exactly 1
// time for requests (e.g. FSReqCallback).
function before(asyncId) { }
-// after is called just after the resource's callback has finished.
+// After is called just after the resource's callback has finished.
function after(asyncId) { }
// destroy is called when an AsyncWrap instance is destroyed.
@@ -159,7 +159,7 @@ const fs = require('fs');
const util = require('util');
function debug(...args) {
- // use a function like this one when debugging inside an AsyncHooks callback
+ // Use a function like this one when debugging inside an AsyncHooks callback
fs.writeFileSync('log.out', `${util.format(...args)}\n`, { flag: 'a' });
}
```
diff --git a/doc/api/crypto.md b/doc/api/crypto.md
index 3e1de25f750feb..736ac360c903d7 100644
--- a/doc/api/crypto.md
+++ b/doc/api/crypto.md
@@ -772,7 +772,7 @@ const uncompressedKey = ECDH.convertKey(compressedKey,
'hex',
'uncompressed');
-// the converted key and the uncompressed public key should be the same
+// The converted key and the uncompressed public key should be the same
console.log(uncompressedKey === ecdh.getPublicKey('hex'));
```
diff --git a/doc/api/domain.md b/doc/api/domain.md
index eec763600e228f..3a1027f07b8afa 100644
--- a/doc/api/domain.md
+++ b/doc/api/domain.md
@@ -143,7 +143,7 @@ if (cluster.isMaster) {
// a new worker.
cluster.worker.disconnect();
- // try to send an error to the request that triggered the problem
+ // Try to send an error to the request that triggered the problem
res.statusCode = 500;
res.setHeader('content-type', 'text/plain');
res.end('Oops, there was a problem!\n');
diff --git a/doc/api/errors.md b/doc/api/errors.md
index 1c16e05de84ac2..05ecad70214fb4 100644
--- a/doc/api/errors.md
+++ b/doc/api/errors.md
@@ -371,7 +371,7 @@ range, or outside the set of options for a given function parameter.
```js
require('net').connect(-1);
-// throws "RangeError: "port" option should be >= 0 and < 65536: -1"
+// Throws "RangeError: "port" option should be >= 0 and < 65536: -1"
```
Node.js will generate and throw `RangeError` instances *immediately* as a form
@@ -388,7 +388,7 @@ will do so.
```js
doesNotExist;
-// throws ReferenceError, doesNotExist is not a variable in this program.
+// Throws ReferenceError, doesNotExist is not a variable in this program.
```
Unless an application is dynamically generating and running code,
diff --git a/doc/api/events.md b/doc/api/events.md
index aafdbcf735bee5..4fcaeb3211c4f2 100644
--- a/doc/api/events.md
+++ b/doc/api/events.md
@@ -638,14 +638,14 @@ emitter.once('log', () => console.log('log once'));
const listeners = emitter.rawListeners('log');
const logFnWrapper = listeners[0];
-// logs "log once" to the console and does not unbind the `once` event
+// Logs "log once" to the console and does not unbind the `once` event
logFnWrapper.listener();
// logs "log once" to the console and removes the listener
logFnWrapper();
emitter.on('log', () => console.log('log persistently'));
-// will return a new Array with a single function bound by `.on()` above
+// Will return a new Array with a single function bound by `.on()` above
const newListeners = emitter.rawListeners('log');
// logs "log persistently" twice
diff --git a/doc/api/fs.md b/doc/api/fs.md
index fcd42fd19af1cd..01d537d8e3b40d 100644
--- a/doc/api/fs.md
+++ b/doc/api/fs.md
@@ -1926,7 +1926,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 10 bytes, whereas the actual size is 7 bytes
+// Truncate the file to 10 bytes, whereas the actual size is 7 bytes
fs.ftruncate(fd, 10, (err) => {
assert.ifError(err);
console.log(fs.readFileSync('temp.txt'));
diff --git a/doc/api/http.md b/doc/api/http.md
index aaeb9403ff499b..63f4c58a85d9bd 100644
--- a/doc/api/http.md
+++ b/doc/api/http.md
@@ -129,6 +129,8 @@ added: v0.3.4
* `timeout` {number} Socket timeout in milliseconds.
This will set the timeout after the socket is connected.
+`options` in [`socket.connect()`][] are also supported.
+
The default [`http.globalAgent`][] that is used by [`http.request()`][] has all
of these values set to their respective defaults.
@@ -2075,9 +2077,9 @@ will be emitted in the following order:
* `'socket'`
* (`req.abort()` called here)
* `'abort'`
-* `'close'`
* `'error'` with an error with message `'Error: socket hang up'` and code
`'ECONNRESET'`
+* `'close'`
If `req.abort()` is called after the response is received, the following events
will be emitted in the following order:
@@ -2087,10 +2089,10 @@ will be emitted in the following order:
* `'data'` any number of times, on the `res` object
* (`req.abort()` called here)
* `'abort'`
+* `'aborted'` on the `res` object
* `'close'`
- * `'aborted'` on the `res` object
- * `'end'` on the `res` object
- * `'close'` on the `res` object
+* `'end'` on the `res` object
+* `'close'` on the `res` object
Note that setting the `timeout` option or using the `setTimeout()` function will
not abort the request or do anything besides add a `'timeout'` event.
@@ -2139,6 +2141,7 @@ not abort the request or do anything besides add a `'timeout'` event.
[`server.listen()`]: net.html#net_server_listen
[`server.timeout`]: #http_server_timeout
[`setHeader(name, value)`]: #http_request_setheader_name_value
+[`socket.connect()`]: net.html#net_socket_connect_options_connectlistener
[`socket.setKeepAlive()`]: net.html#net_socket_setkeepalive_enable_initialdelay
[`socket.setNoDelay()`]: net.html#net_socket_setnodelay_nodelay
[`socket.setTimeout()`]: net.html#net_socket_settimeout_timeout_callback
diff --git a/doc/api/modules.md b/doc/api/modules.md
index 28a13fb36dc4b9..5292d2389760bd 100644
--- a/doc/api/modules.md
+++ b/doc/api/modules.md
@@ -49,7 +49,7 @@ console.log(`The area of mySquare is ${mySquare.area()}`);
The `square` module is defined in `square.js`:
```js
-// assigning to exports will not modify module, must use module.exports
+// Assigning to exports will not modify module, must use module.exports
module.exports = class Square {
constructor(width) {
this.width = width;
diff --git a/doc/api/process.md b/doc/api/process.md
index 64d93a87603ef6..818bb6ed4ab73c 100644
--- a/doc/api/process.md
+++ b/doc/api/process.md
@@ -286,7 +286,7 @@ The listener function is called with the following arguments:
```js
process.on('unhandledRejection', (reason, p) => {
console.log('Unhandled Rejection at:', p, 'reason:', reason);
- // application specific logging, throwing an error, or other logic here
+ // Application specific logging, throwing an error, or other logic here
});
somePromise.then((res) => {
diff --git a/doc/api/stream.md b/doc/api/stream.md
index 5441cb03724d05..c1f23adae5a30b 100644
--- a/doc/api/stream.md
+++ b/doc/api/stream.md
@@ -131,7 +131,7 @@ const server = http.createServer((req, res) => {
body += chunk;
});
- // the 'end' event indicates that the entire body has been received
+ // The 'end' event indicates that the entire body has been received
req.on('end', () => {
try {
const data = JSON.parse(body);
diff --git a/doc/api/tls.md b/doc/api/tls.md
index 89f0021d740111..d16af379e12f82 100644
--- a/doc/api/tls.md
+++ b/doc/api/tls.md
@@ -1054,6 +1054,9 @@ argument.
* `maxArrayLength` {integer} Specifies the maximum number of `Array`,
[`TypedArray`][], [`WeakMap`][] and [`WeakSet`][] elements to include when
formatting. Set to `null` or `Infinity` to show all elements. Set to `0` or
@@ -454,6 +453,11 @@ changes:
of an object and Set and Map entries will be sorted in the returned string.
If set to `true` the [default sort][] is going to be used. If set to a
function, it is used as a [compare function][].
+ * `getters` {boolean|string} If set to `true`, getters are going to be
+ inspected as well. If set to `'get'` only getters without setter are going
+ to be inspected. If set to `'set'` only getters having a corresponding
+ setter are going to be inspected. This might cause side effects depending on
+ the getter function. **Default:** `false`.
* Returns: {string} The representation of passed object
The `util.inspect()` method returns a string representation of `object` that is
diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md
index 0fc133376d35d4..d6c396d3ac69dd 100644
--- a/doc/api/worker_threads.md
+++ b/doc/api/worker_threads.md
@@ -109,7 +109,7 @@ const { MessageChannel } = require('worker_threads');
const { port1, port2 } = new MessageChannel();
port1.on('message', (message) => console.log('received', message));
port2.postMessage({ foo: 'bar' });
-// prints: received { foo: 'bar' } from the `port1.on('message')` listener
+// Prints: received { foo: 'bar' } from the `port1.on('message')` listener
```
## Class: MessagePort
@@ -125,7 +125,7 @@ structured data, memory regions and other `MessagePort`s between different
[`Worker`][]s.
With the exception of `MessagePort`s being [`EventEmitter`][]s rather
-than `EventTarget`s, this implementation matches [browser `MessagePort`][]s.
+than [`EventTarget`][]s, this implementation matches [browser `MessagePort`][]s.
### Event: 'close'
+* Extends: {EventEmitter}
+
The `Worker` class represents an independent JavaScript execution thread.
Most Node.js APIs are available inside of it.
@@ -306,10 +308,10 @@ if (isMainThread) {
* `filename` {string} The path to the Worker’s main script. Must be
either an absolute path or a relative path (i.e. relative to the
current working directory) starting with `./` or `../`.
- If `options.eval` is true, this is a string containing JavaScript code rather
- than a path.
+ If `options.eval` is `true`, this is a string containing JavaScript code
+ rather than a path.
* `options` {Object}
- * `eval` {boolean} If true, interpret the first argument to the constructor
+ * `eval` {boolean} If `true`, interpret the first argument to the constructor
as a script that is executed once the worker is online.
* `workerData` {any} Any JavaScript value that will be cloned and made
available as [`require('worker_threads').workerData`][]. The cloning will
@@ -462,6 +464,7 @@ active handle in the event system. If the worker is already `unref()`ed calling
[`Buffer`]: buffer.html
[`EventEmitter`]: events.html
+[`EventTarget`]: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget
[`MessagePort`]: #worker_threads_class_messageport
[`SharedArrayBuffer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer
[`Uint8Array`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array
diff --git a/doc/changelogs/CHANGELOG_V11.md b/doc/changelogs/CHANGELOG_V11.md
index 3e0553fa837345..bbb8610acd43c6 100644
--- a/doc/changelogs/CHANGELOG_V11.md
+++ b/doc/changelogs/CHANGELOG_V11.md
@@ -9,6 +9,7 @@
|