9.11.1
diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md
index a7b1e68d7276a9..0cb03822c98947 100644
--- a/COLLABORATOR_GUIDE.md
+++ b/COLLABORATOR_GUIDE.md
@@ -416,14 +416,15 @@ longer be used.
Node.js uses three Deprecation levels:
-* *Documentation-Only Deprecation* refers to elements of the Public API that are
- being staged for deprecation in a future Node.js major release. An explicit
- notice indicating the deprecated status is added to the API documentation
- but no functional changes are implemented in the code. There will be no
- runtime deprecation warnings emitted for such deprecations by default.
- Documentation-only deprecations may trigger a runtime warning when Node.js
- is started with the [`--pending-deprecation`][] flag or the
- `NODE_PENDING_DEPRECATION=1` environment variable is set.
+* *Documentation-Only Deprecation* refers to elements of the Public API that
+ should be avoided by developers and that might be staged for a runtime
+ deprecation in a future Node.js major release. An explicit notice indicating
+ the deprecation status is added to the API documentation but no functional
+ changes are implemented in the code. By default there will be no deprecation
+ warnings emitted for such deprecations at runtime. Documentation-only
+ deprecations may trigger a runtime warning when Node.js is started with the
+ [`--pending-deprecation`][] flag or the `NODE_PENDING_DEPRECATION=1`
+ environment variable is set.
* *Runtime Deprecation* refers to the use of process warnings emitted at
runtime the first time that a deprecated API is used. A command-line
@@ -489,8 +490,7 @@ The TSC should serve as the final arbiter where required.
1. Never use GitHub's green ["Merge Pull Request"][] button. Reasons for not
using the web interface button:
* The merge method will add an unnecessary merge commit.
- * The squash & merge method has been known to add metadata to the commit
- title (the PR #).
+ * The squash & merge method can add metadata (the PR #) to the commit title.
* If more than one author has contributed to the PR, keep the most recent
author when squashing.
1. Make sure the CI is done and the result is green. If the CI is not green,
@@ -832,7 +832,6 @@ LTS working group and the Release team.
| Subsystem | Maintainers |
| --- | --- |
| `benchmark/*` | @nodejs/benchmarking, @mscdex |
-| `bootstrap_node.js` | @nodejs/process |
| `doc/*`, `*.md` | @nodejs/documentation |
| `lib/assert` | @nodejs/testing |
| `lib/async_hooks` | @nodejs/async\_hooks for bugs/reviews (+ @nodejs/diagnostics for API) |
@@ -845,6 +844,7 @@ LTS working group and the Release team.
| `lib/fs`, `src/{fs,file}` | @nodejs/fs |
| `lib/{_}http{*}` | @nodejs/http |
| `lib/inspector.js`, `src/inspector_*` | @nodejs/V8-inspector |
+| `lib/internal/bootstrap/*` | @nodejs/process |
| `lib/internal/url`, `src/node_url` | @nodejs/url |
| `lib/net` | @bnoordhuis, @indutny, @nodejs/streams |
| `lib/repl` | @nodejs/repl |
@@ -852,13 +852,13 @@ LTS working group and the Release team.
| `lib/timers` | @nodejs/timers |
| `lib/util` | @nodejs/util |
| `lib/zlib` | @nodejs/zlib |
-| `src/async-wrap.*` | @nodejs/async\_hooks |
+| `src/async_wrap.*` | @nodejs/async\_hooks |
| `src/node_api.*` | @nodejs/n-api |
| `src/node_crypto.*` | @nodejs/crypto |
| `test/*` | @nodejs/testing |
| `tools/node_modules/eslint`, `.eslintrc` | @nodejs/linting |
| build | @nodejs/build |
-| `src/module_wrap.*`, `lib/internal/loader/*`, `lib/internal/vm/Module.js` | @nodejs/modules |
+| `src/module_wrap.*`, `lib/internal/modules/*`, `lib/internal/vm/module.js` | @nodejs/modules |
| GYP | @nodejs/gyp |
| performance | @nodejs/performance |
| platform specific | @nodejs/platform-{aix,arm,freebsd,macos,ppc,smartos,s390,windows} |
diff --git a/CPP_STYLE_GUIDE.md b/CPP_STYLE_GUIDE.md
index edc5f0f12e212c..41e1f082f87751 100644
--- a/CPP_STYLE_GUIDE.md
+++ b/CPP_STYLE_GUIDE.md
@@ -12,6 +12,7 @@
* [CamelCase for methods, functions, and classes](#camelcase-for-methods-functions-and-classes)
* [snake\_case for local variables and parameters](#snake_case-for-local-variables-and-parameters)
* [snake\_case\_ for private class fields](#snake_case_-for-private-class-fields)
+ * [snake\_case\_ for C-like structs](#snake_case_-for-c-like-structs)
* [Space after `template`](#space-after-template)
* [Memory Management](#memory-management)
* [Memory allocation](#memory-allocation)
@@ -147,6 +148,15 @@ class Foo {
};
```
+## snake\_case\_ for C-like structs
+For plain C-like structs snake_case can be used.
+
+```c++
+struct foo_bar {
+ int name;
+}
+```
+
## Space after `template`
```c++
diff --git a/Makefile b/Makefile
index f499788d9d86cc..02d97b633d87d6 100644
--- a/Makefile
+++ b/Makefile
@@ -393,7 +393,7 @@ clear-stalled:
ps awwx | grep Release/node | grep -v grep | cat
@PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
if [ "$${PS_OUT}" ]; then \
- echo $${PS_OUT} | xargs kill; \
+ echo $${PS_OUT} | xargs kill -9; \
fi
.PHONY: test-gc
@@ -439,7 +439,7 @@ test-ci-js: | clear-stalled
ps awwx | grep Release/node | grep -v grep | cat
@PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
if [ "$${PS_OUT}" ]; then \
- echo $${PS_OUT} | xargs kill; exit 1; \
+ echo $${PS_OUT} | xargs kill -9; exit 1; \
fi
.PHONY: test-ci
@@ -454,7 +454,7 @@ test-ci: | clear-stalled build-addons build-addons-napi doc-only
ps awwx | grep Release/node | grep -v grep | cat
@PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
if [ "$${PS_OUT}" ]; then \
- echo $${PS_OUT} | xargs kill; exit 1; \
+ echo $${PS_OUT} | xargs kill -9; exit 1; \
fi
.PHONY: build-ci
@@ -652,7 +652,7 @@ tools/doc/node_modules/js-yaml/package.json:
gen-json = tools/doc/generate.js --format=json $< > $@
gen-html = tools/doc/generate.js --node-version=$(FULLVERSION) --format=html \
- --template=doc/template.html --analytics=$(DOCS_ANALYTICS) $< > $@
+ --analytics=$(DOCS_ANALYTICS) $< > $@
out/doc/api/%.json: doc/api/%.md
$(call available-node, $(gen-json))
@@ -813,8 +813,8 @@ release-only:
exit 1 ; \
fi
@if [ "$(DISTTYPE)" != "nightly" ] && [ "$(DISTTYPE)" != "next-nightly" ] && \
- `grep -q DEP00XX doc/api/deprecations.md`; then \
- echo 'Please update DEP00XX in doc/api/deprecations.md (See doc/releases.md)' ; \
+ `grep -q DEP...X doc/api/deprecations.md`; then \
+ echo 'Please update DEP...X in doc/api/deprecations.md (See doc/releases.md)' ; \
exit 1 ; \
fi
@if [ "$(shell git status --porcelain | egrep -v '^\?\? ')" = "" ]; then \
diff --git a/README.md b/README.md
index d39c7639e20d1a..df95961979edae 100644
--- a/README.md
+++ b/README.md
@@ -55,6 +55,8 @@ search these unofficial resources:
* [Questions tagged 'node.js' on StackOverflow][]
* [#node.js channel on chat.freenode.net][]. See for more
information.
+* [Node.js Slack Community](https://node-js.slack.com/): Visit
+ [nodeslackers.com](http://www.nodeslackers.com/) to register.
GitHub issues are meant for tracking enhancements and bugs, not general support.
@@ -512,8 +514,6 @@ For more information about the governance of the Node.js project, see
**Trivikram Kamat** <trivikr.dev@gmail.com>
* [Trott](https://github.com/Trott) -
**Rich Trott** <rtrott@gmail.com> (he/him)
-* [tunniclm](https://github.com/tunniclm) -
-**Mike Tunnicliffe** <m.j.tunnicliffe@gmail.com>
* [vdeturckheim](https://github.com/vdeturckheim) -
**Vladimir de Turckheim** <vlad2t@hotmail.com> (he/him)
* [vkurchatkin](https://github.com/vkurchatkin) -
@@ -557,6 +557,8 @@ For more information about the governance of the Node.js project, see
**Alex Kocharin** <alex@kocharin.ru>
* [tellnes](https://github.com/tellnes) -
**Christian Tellnes** <christian@tellnes.no>
+* [tunniclm](https://github.com/tunniclm) -
+**Mike Tunnicliffe** <m.j.tunnicliffe@gmail.com>
Collaborators follow the [COLLABORATOR_GUIDE.md](./COLLABORATOR_GUIDE.md) in
maintaining the Node.js project.
diff --git a/benchmark/events/ee-add-remove.js b/benchmark/events/ee-add-remove.js
index eee8ff4524ed1a..54e680f74ae3e1 100644
--- a/benchmark/events/ee-add-remove.js
+++ b/benchmark/events/ee-add-remove.js
@@ -2,7 +2,7 @@
const common = require('../common.js');
const events = require('events');
-const bench = common.createBenchmark(main, { n: [25e4] });
+const bench = common.createBenchmark(main, { n: [1e6] });
function main({ n }) {
const ee = new events.EventEmitter();
diff --git a/benchmark/fs/bench-stat-promise.js b/benchmark/fs/bench-stat-promise.js
index b0317455728b46..96c7058fa6218a 100644
--- a/benchmark/fs/bench-stat-promise.js
+++ b/benchmark/fs/bench-stat-promise.js
@@ -1,7 +1,7 @@
'use strict';
const common = require('../common');
-const fsPromises = require('fs/promises');
+const fsPromises = require('fs').promises;
const bench = common.createBenchmark(main, {
n: [20e4],
diff --git a/benchmark/http/headers.js b/benchmark/http/headers.js
new file mode 100644
index 00000000000000..748865afbf3a04
--- /dev/null
+++ b/benchmark/http/headers.js
@@ -0,0 +1,36 @@
+'use strict';
+
+const common = require('../common.js');
+const http = require('http');
+
+const bench = common.createBenchmark(main, {
+ duplicates: [1, 100],
+ n: [10, 1000],
+});
+
+function main({ duplicates, n }) {
+ const headers = {
+ 'Connection': 'keep-alive',
+ 'Transfer-Encoding': 'chunked',
+ };
+
+ for (var i = 0; i < n / duplicates; i++) {
+ headers[`foo${i}`] = [];
+ for (var j = 0; j < duplicates; j++) {
+ headers[`foo${i}`].push(`some header value ${i}`);
+ }
+ }
+
+ const server = http.createServer(function(req, res) {
+ res.writeHead(200, headers);
+ res.end();
+ });
+ server.listen(common.PORT, function() {
+ bench.http({
+ path: '/',
+ connections: 10
+ }, function() {
+ server.close();
+ });
+ });
+}
diff --git a/benchmark/process/next-tick-depth-args.js b/benchmark/process/next-tick-depth-args.js
index 52d349c776b326..a7670d99efc354 100644
--- a/benchmark/process/next-tick-depth-args.js
+++ b/benchmark/process/next-tick-depth-args.js
@@ -8,13 +8,14 @@ const bench = common.createBenchmark(main, {
process.maxTickDepth = Infinity;
function main({ n }) {
+ let counter = n;
function cb4(arg1, arg2, arg3, arg4) {
- if (--n) {
- if (n % 4 === 0)
+ if (--counter) {
+ if (counter % 4 === 0)
process.nextTick(cb4, 3.14, 1024, true, false);
- else if (n % 3 === 0)
+ else if (counter % 3 === 0)
process.nextTick(cb3, 512, true, null);
- else if (n % 2 === 0)
+ else if (counter % 2 === 0)
process.nextTick(cb2, false, 5.1);
else
process.nextTick(cb1, 0);
@@ -22,12 +23,12 @@ function main({ n }) {
bench.end(n);
}
function cb3(arg1, arg2, arg3) {
- if (--n) {
- if (n % 4 === 0)
+ if (--counter) {
+ if (counter % 4 === 0)
process.nextTick(cb4, 3.14, 1024, true, false);
- else if (n % 3 === 0)
+ else if (counter % 3 === 0)
process.nextTick(cb3, 512, true, null);
- else if (n % 2 === 0)
+ else if (counter % 2 === 0)
process.nextTick(cb2, false, 5.1);
else
process.nextTick(cb1, 0);
@@ -35,12 +36,12 @@ function main({ n }) {
bench.end(n);
}
function cb2(arg1, arg2) {
- if (--n) {
- if (n % 4 === 0)
+ if (--counter) {
+ if (counter % 4 === 0)
process.nextTick(cb4, 3.14, 1024, true, false);
- else if (n % 3 === 0)
+ else if (counter % 3 === 0)
process.nextTick(cb3, 512, true, null);
- else if (n % 2 === 0)
+ else if (counter % 2 === 0)
process.nextTick(cb2, false, 5.1);
else
process.nextTick(cb1, 0);
@@ -48,12 +49,12 @@ function main({ n }) {
bench.end(n);
}
function cb1(arg1) {
- if (--n) {
- if (n % 4 === 0)
+ if (--counter) {
+ if (counter % 4 === 0)
process.nextTick(cb4, 3.14, 1024, true, false);
- else if (n % 3 === 0)
+ else if (counter % 3 === 0)
process.nextTick(cb3, 512, true, null);
- else if (n % 2 === 0)
+ else if (counter % 2 === 0)
process.nextTick(cb2, false, 5.1);
else
process.nextTick(cb1, 0);
diff --git a/benchmark/process/next-tick-depth.js b/benchmark/process/next-tick-depth.js
index 6669936e398272..1ad32c806181b0 100644
--- a/benchmark/process/next-tick-depth.js
+++ b/benchmark/process/next-tick-depth.js
@@ -7,11 +7,11 @@ const bench = common.createBenchmark(main, {
process.maxTickDepth = Infinity;
function main({ n }) {
-
+ let counter = n;
bench.start();
process.nextTick(onNextTick);
function onNextTick() {
- if (--n)
+ if (--counter)
process.nextTick(onNextTick);
else
bench.end(n);
diff --git a/benchmark/process/next-tick-exec-args.js b/benchmark/process/next-tick-exec-args.js
index 3be86cc08e177a..f5d0fb94224148 100644
--- a/benchmark/process/next-tick-exec-args.js
+++ b/benchmark/process/next-tick-exec-args.js
@@ -5,8 +5,11 @@ const bench = common.createBenchmark(main, {
});
function main({ n }) {
+ function onNextTick(i) {
+ if (i + 1 === n)
+ bench.end(n);
+ }
- bench.start();
for (var i = 0; i < n; i++) {
if (i % 4 === 0)
process.nextTick(onNextTick, i, true, 10, 'test');
@@ -17,8 +20,6 @@ function main({ n }) {
else
process.nextTick(onNextTick, i);
}
- function onNextTick(i) {
- if (i + 1 === n)
- bench.end(n);
- }
+
+ bench.start();
}
diff --git a/benchmark/process/next-tick-exec.js b/benchmark/process/next-tick-exec.js
index d00ee017de4bff..936b253bfaf324 100644
--- a/benchmark/process/next-tick-exec.js
+++ b/benchmark/process/next-tick-exec.js
@@ -5,13 +5,14 @@ const bench = common.createBenchmark(main, {
});
function main({ n }) {
-
- bench.start();
- for (var i = 0; i < n; i++) {
- process.nextTick(onNextTick, i);
- }
function onNextTick(i) {
if (i + 1 === n)
bench.end(n);
}
+
+ for (var i = 0; i < n; i++) {
+ process.nextTick(onNextTick, i);
+ }
+
+ bench.start();
}
diff --git a/benchmark/util/splice-one.js b/benchmark/util/splice-one.js
new file mode 100644
index 00000000000000..5c2a39f6d72a11
--- /dev/null
+++ b/benchmark/util/splice-one.js
@@ -0,0 +1,33 @@
+'use strict';
+
+const common = require('../common');
+
+const bench = common.createBenchmark(main, {
+ n: [1e7],
+ pos: ['start', 'middle', 'end'],
+ size: [10, 100, 500],
+}, { flags: ['--expose-internals'] });
+
+function main({ n, pos, size }) {
+ const { spliceOne } = require('internal/util');
+ const arr = new Array(size);
+ arr.fill('');
+ let index;
+ switch (pos) {
+ case 'end':
+ index = size - 1;
+ break;
+ case 'middle':
+ index = Math.floor(size / 2);
+ break;
+ default: // start
+ index = 0;
+ }
+
+ bench.start();
+ for (var i = 0; i < n; i++) {
+ spliceOne(arr, index);
+ arr.push('');
+ }
+ bench.end(n);
+}
diff --git a/benchmark/zlib/pipe.js b/benchmark/zlib/pipe.js
new file mode 100644
index 00000000000000..9b05749bbb824d
--- /dev/null
+++ b/benchmark/zlib/pipe.js
@@ -0,0 +1,39 @@
+'use strict';
+const common = require('../common.js');
+const fs = require('fs');
+const zlib = require('zlib');
+
+const bench = common.createBenchmark(main, {
+ inputLen: [1024],
+ duration: [5],
+ type: ['string', 'buffer']
+});
+
+function main({ inputLen, duration, type }) {
+ const buffer = Buffer.alloc(inputLen, fs.readFileSync(__filename));
+ const chunk = type === 'buffer' ? buffer : buffer.toString('utf8');
+
+ const input = zlib.createGzip();
+ const output = zlib.createGunzip();
+
+ let readFromOutput = 0;
+ input.pipe(output);
+ if (type === 'string')
+ output.setEncoding('utf8');
+ output.on('data', (chunk) => readFromOutput += chunk.length);
+
+ function write() {
+ input.write(chunk, write);
+ }
+
+ bench.start();
+ write();
+
+ setTimeout(() => {
+ // Give result in GBit/s, like the net benchmarks do
+ bench.end(readFromOutput * 8 / (1024 ** 3));
+
+ // Cut off writing the easy way.
+ input.write = () => {};
+ }, duration * 1000);
+}
diff --git a/common.gypi b/common.gypi
index d1304a14478d2c..3bb10d611fb1d5 100644
--- a/common.gypi
+++ b/common.gypi
@@ -27,7 +27,7 @@
# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
- 'v8_embedder_string': '-node.5',
+ 'v8_embedder_string': '-node.6',
# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,
diff --git a/configure b/configure
index c1170f9a132a16..17e13a48d47e5a 100755
--- a/configure
+++ b/configure
@@ -501,11 +501,6 @@ parser.add_option('--without-node-options',
dest='without_node_options',
help='build without NODE_OPTIONS support')
-parser.add_option('--xcode',
- action='store_true',
- dest='use_xcode',
- help='generate build files for use with xcode')
-
parser.add_option('--ninja',
action='store_true',
dest='use_ninja',
@@ -1005,9 +1000,6 @@ def configure_node(o):
o['variables']['asan'] = int(options.enable_asan or 0)
- if options.use_xcode and options.use_ninja:
- raise Exception('--xcode and --ninja cannot be used together.')
-
if options.coverage:
o['variables']['coverage'] = 'true'
else:
@@ -1530,7 +1522,6 @@ write('config.gypi', do_not_edit +
config = {
'BUILDTYPE': 'Debug' if options.debug else 'Release',
- 'USE_XCODE': str(int(options.use_xcode or 0)),
'PYTHON': sys.executable,
'NODE_TARGET_TYPE': variables['node_target_type'],
}
@@ -1549,9 +1540,7 @@ write('config.mk', do_not_edit + config)
gyp_args = ['--no-parallel']
-if options.use_xcode:
- gyp_args += ['-f', 'xcode']
-elif options.use_ninja:
+if options.use_ninja:
gyp_args += ['-f', 'ninja']
elif flavor == 'win' and sys.platform != 'msys':
gyp_args += ['-f', 'msvs', '-G', 'msvs_version=auto']
diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h
index 68d0a359292bd7..81f014cbd4b68d 100644
--- a/deps/v8/include/v8-version.h
+++ b/deps/v8/include/v8-version.h
@@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 6
#define V8_MINOR_VERSION 6
#define V8_BUILD_NUMBER 346
-#define V8_PATCH_LEVEL 24
+#define V8_PATCH_LEVEL 27
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
diff --git a/deps/v8/src/builtins/builtins-object-gen.cc b/deps/v8/src/builtins/builtins-object-gen.cc
index 1ebfbacf38ecb6..3fb8d7792d6df0 100644
--- a/deps/v8/src/builtins/builtins-object-gen.cc
+++ b/deps/v8/src/builtins/builtins-object-gen.cc
@@ -268,7 +268,7 @@ TNode ObjectEntriesValuesBuiltinsAssembler::FastGetOwnValuesOrEntries(
object_enum_length, IntPtrConstant(kInvalidEnumCacheSentinel));
// In case, we found enum_cache in object,
- // we use it as array_length becuase it has same size for
+ // we use it as array_length because it has same size for
// Object.(entries/values) result array object length.
// So object_enum_length use less memory space than
// NumberOfOwnDescriptorsBits value.
@@ -285,7 +285,7 @@ TNode ObjectEntriesValuesBuiltinsAssembler::FastGetOwnValuesOrEntries(
INTPTR_PARAMETERS, kAllowLargeObjectAllocation));
// If in case we have enum_cache,
- // we can't detect accessor of object until loop through descritpros.
+ // we can't detect accessor of object until loop through descriptors.
// So if object might have accessor,
// we will remain invalid addresses of FixedArray.
// Because in that case, we need to jump to runtime call.
@@ -299,7 +299,7 @@ TNode ObjectEntriesValuesBuiltinsAssembler::FastGetOwnValuesOrEntries(
Variable* vars[] = {&var_descriptor_number, &var_result_index};
// Let desc be ? O.[[GetOwnProperty]](key).
TNode descriptors = LoadMapDescriptors(map);
- Label loop(this, 2, vars), after_loop(this), loop_condition(this);
+ Label loop(this, 2, vars), after_loop(this), next_descriptor(this);
Branch(IntPtrEqual(var_descriptor_number.value(), object_enum_length),
&after_loop, &loop);
@@ -316,7 +316,7 @@ TNode ObjectEntriesValuesBuiltinsAssembler::FastGetOwnValuesOrEntries(
Node* next_key = DescriptorArrayGetKey(descriptors, descriptor_index);
// Skip Symbols.
- GotoIf(IsSymbol(next_key), &loop_condition);
+ GotoIf(IsSymbol(next_key), &next_descriptor);
TNode details = TNode::UncheckedCast(
DescriptorArrayGetDetails(descriptors, descriptor_index));
@@ -326,8 +326,9 @@ TNode ObjectEntriesValuesBuiltinsAssembler::FastGetOwnValuesOrEntries(
GotoIf(IsPropertyKindAccessor(kind), if_call_runtime_with_fast_path);
CSA_ASSERT(this, IsPropertyKindData(kind));
- // If desc is not undefined and desc.[[Enumerable]] is true, then
- GotoIfNot(IsPropertyEnumerable(details), &loop_condition);
+ // If desc is not undefined and desc.[[Enumerable]] is true, then skip to
+ // the next descriptor.
+ GotoIfNot(IsPropertyEnumerable(details), &next_descriptor);
VARIABLE(var_property_value, MachineRepresentation::kTagged,
UndefinedConstant());
@@ -357,12 +358,12 @@ TNode ObjectEntriesValuesBuiltinsAssembler::FastGetOwnValuesOrEntries(
StoreFixedArrayElement(values_or_entries, var_result_index.value(),
value);
Increment(&var_result_index, 1);
- Goto(&loop_condition);
+ Goto(&next_descriptor);
- BIND(&loop_condition);
+ BIND(&next_descriptor);
{
Increment(&var_descriptor_number, 1);
- Branch(IntPtrEqual(var_descriptor_number.value(), object_enum_length),
+ Branch(IntPtrEqual(var_result_index.value(), object_enum_length),
&after_loop, &loop);
}
}
diff --git a/deps/v8/src/keys.cc b/deps/v8/src/keys.cc
index 4f59c2553caf0c..638c83f4270b95 100644
--- a/deps/v8/src/keys.cc
+++ b/deps/v8/src/keys.cc
@@ -77,7 +77,14 @@ void KeyAccumulator::AddKey(Handle
-
[Readable](#stream_class_stream_readable)
+
[`Readable`](#stream_class_stream_readable)
[_read][stream-_read]
@@ -1447,7 +1449,7 @@ on the type of stream being created, as detailed in the chart below:
Writing only
-
[Writable](#stream_class_stream_writable)
+
[`Writable`](#stream_class_stream_writable)
@@ -1462,7 +1464,7 @@ on the type of stream being created, as detailed in the chart below:
Reading and writing
-
[Duplex](#stream_class_stream_duplex)
+
[`Duplex`](#stream_class_stream_duplex)
@@ -1477,7 +1479,7 @@ on the type of stream being created, as detailed in the chart below:
Operate on written data, then read the result
-
[Transform](#stream_class_stream_transform)
+
[`Transform`](#stream_class_stream_transform)
@@ -1516,9 +1518,9 @@ const myWritable = new Writable({
### Implementing a Writable Stream
-The `stream.Writable` class is extended to implement a [Writable][] stream.
+The `stream.Writable` class is extended to implement a [`Writable`][] stream.
-Custom Writable streams *must* call the `new stream.Writable([options])`
+Custom `Writable` streams *must* call the `new stream.Writable([options])`
constructor and implement the `writable._write()` method. The
`writable._writev()` method *may* also be implemented.
@@ -1536,7 +1538,7 @@ changes:
[`stream.write()`][stream-write] starts returning `false`. **Default:**
`16384` (16kb), or `16` for `objectMode` streams.
* `decodeStrings` {boolean} Whether or not to decode strings into
- Buffers before passing them to [`stream._write()`][stream-_write].
+ `Buffer`s before passing them to [`stream._write()`][stream-_write].
**Default:** `true`.
* `objectMode` {boolean} Whether or not the
[`stream.write(anyObj)`][stream-write] is a valid operation. When set,
@@ -1606,16 +1608,16 @@ const myWritable = new Writable({
* `callback` {Function} Call this function (optionally with an error
argument) when processing is complete for the supplied chunk.
-All Writable stream implementations must provide a
+All `Writable` stream implementations must provide a
[`writable._write()`][stream-_write] method to send data to the underlying
resource.
-[Transform][] streams provide their own implementation of the
+[`Transform`][] streams provide their own implementation of the
[`writable._write()`][stream-_write].
This function MUST NOT be called by application code directly. It should be
-implemented by child classes, and called by the internal Writable class methods
-only.
+implemented by child classes, and called by the internal `Writable` class
+methods only.
The `callback` method must be called to signal either that the write completed
successfully or failed with an error. The first argument passed to the
@@ -1647,8 +1649,8 @@ user programs.
argument) to be invoked when processing is complete for the supplied chunks.
This function MUST NOT be called by application code directly. It should be
-implemented by child classes, and called by the internal Writable class methods
-only.
+implemented by child classes, and called by the internal `Writable` class
+methods only.
The `writable._writev()` method may be implemented in addition to
`writable._write()` in stream implementations that are capable of processing
@@ -1680,7 +1682,7 @@ added: v8.0.0
argument) when finished writing any remaining data.
The `_final()` method **must not** be called directly. It may be implemented
-by child classes, and if so, will be called by the internal Writable
+by child classes, and if so, will be called by the internal `Writable`
class methods only.
This optional function will be called before the stream closes, delaying the
@@ -1692,13 +1694,13 @@ or write buffered data before a stream ends.
It is recommended that errors occurring during the processing of the
`writable._write()` and `writable._writev()` methods are reported by invoking
the callback and passing the error as the first argument. This will cause an
-`'error'` event to be emitted by the Writable. Throwing an Error from within
+`'error'` event to be emitted by the `Writable`. Throwing an `Error` from within
`writable._write()` can result in unexpected and inconsistent behavior depending
on how the stream is being used. Using the callback ensures consistent and
predictable handling of errors.
-If a Readable stream pipes into a Writable stream when Writable emits an
-error, the Readable stream will be unpiped.
+If a `Readable` stream pipes into a `Writable` stream when `Writable` emits an
+error, the `Readable` stream will be unpiped.
```js
const { Writable } = require('stream');
@@ -1717,9 +1719,9 @@ const myWritable = new Writable({
#### An Example Writable Stream
The following illustrates a rather simplistic (and somewhat pointless) custom
-Writable stream implementation. While this specific Writable stream instance
+`Writable` stream implementation. While this specific `Writable` stream instance
is not of any real particular usefulness, the example illustrates each of the
-required elements of a custom [Writable][] stream instance:
+required elements of a custom [`Writable`][] stream instance:
```js
const { Writable } = require('stream');
@@ -1745,7 +1747,7 @@ class MyWritable extends Writable {
Decoding buffers is a common task, for instance, when using transformers whose
input is a string. This is not a trivial process when using multi-byte
characters encoding, such as UTF-8. The following example shows how to decode
-multi-byte strings using `StringDecoder` and [Writable][].
+multi-byte strings using `StringDecoder` and [`Writable`][].
```js
const { Writable } = require('stream');
@@ -1782,9 +1784,9 @@ console.log(w.data); // currency: €
### Implementing a Readable Stream
-The `stream.Readable` class is extended to implement a [Readable][] stream.
+The `stream.Readable` class is extended to implement a [`Readable`][] stream.
-Custom Readable streams *must* call the `new stream.Readable([options])`
+Custom `Readable` streams *must* call the `new stream.Readable([options])`
constructor and implement the `readable._read()` method.
#### new stream.Readable([options])
@@ -1797,7 +1799,7 @@ constructor and implement the `readable._read()` method.
strings using the specified encoding. **Default:** `null`.
* `objectMode` {boolean} Whether this stream should behave
as a stream of objects. Meaning that [`stream.read(n)`][stream-read] returns
- a single value instead of a Buffer of size n. **Default:** `false`.
+ a single value instead of a `Buffer` of size `n`. **Default:** `false`.
* `read` {Function} Implementation for the [`stream._read()`][stream-_read]
method.
* `destroy` {Function} Implementation for the
@@ -1847,16 +1849,16 @@ added: v0.9.4
changes:
- version: v10.0.0
pr-url: https://github.com/nodejs/node/pull/17979
- description: call _read() only once per microtick
+ description: call `_read()` only once per microtick
-->
* `size` {number} Number of bytes to read asynchronously
This function MUST NOT be called by application code directly. It should be
-implemented by child classes, and called by the internal Readable class methods
-only.
+implemented by child classes, and called by the internal `Readable` class
+methods only.
-All Readable stream implementations must provide an implementation of the
+All `Readable` stream implementations must provide an implementation of the
`readable._read()` method to fetch data from the underlying resource.
When `readable._read()` is called, if data is available from the resource, the
@@ -1906,7 +1908,7 @@ changes:
string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be
any JavaScript value.
* `encoding` {string} Encoding of string chunks. Must be a valid
- Buffer encoding, such as `'utf8'` or `'ascii'`
+ `Buffer` encoding, such as `'utf8'` or `'ascii'`.
* Returns: {boolean} `true` if additional chunks of data may continued to be
pushed; `false` otherwise.
@@ -1915,18 +1917,18 @@ be added to the internal queue for users of the stream to consume.
Passing `chunk` as `null` signals the end of the stream (EOF), after which no
more data can be written.
-When the Readable is operating in paused mode, the data added with
+When the `Readable` is operating in paused mode, the data added with
`readable.push()` can be read out by calling the
[`readable.read()`][stream-read] method when the [`'readable'`][] event is
emitted.
-When the Readable is operating in flowing mode, the data added with
+When the `Readable` is operating in flowing mode, the data added with
`readable.push()` will be delivered by emitting a `'data'` event.
The `readable.push()` method is designed to be as flexible as possible. For
example, when wrapping a lower-level source that provides some form of
pause/resume mechanism, and a data callback, the low-level source can be wrapped
-by the custom Readable instance as illustrated in the following example:
+by the custom `Readable` instance as illustrated in the following example:
```js
// source is an object with readStop() and readStart() methods,
@@ -1959,8 +1961,8 @@ class SourceWrapper extends Readable {
}
```
-The `readable.push()` method is intended be called only by Readable
-Implementers, and only from within the `readable._read()` method.
+The `readable.push()` method is intended be called only by `Readable`
+implementers, and only from within the `readable._read()` method.
For streams not operating in object mode, if the `chunk` parameter of
`readable.push()` is `undefined`, it will be treated as empty string or
@@ -1970,7 +1972,7 @@ buffer. See [`readable.push('')`][] for more information.
It is recommended that errors occurring during the processing of the
`readable._read()` method are emitted using the `'error'` event rather than
-being thrown. Throwing an Error from within `readable._read()` can result in
+being thrown. Throwing an `Error` from within `readable._read()` can result in
unexpected and inconsistent behavior depending on whether the stream is
operating in flowing or paused mode. Using the `'error'` event ensures
consistent and predictable handling of errors.
@@ -1994,7 +1996,7 @@ const myReadable = new Readable({
-The following is a basic example of a Readable stream that emits the numerals
+The following is a basic example of a `Readable` stream that emits the numerals
from 1 to 1,000,000 in ascending order, and then ends.
```js
@@ -2022,11 +2024,11 @@ class Counter extends Readable {
### Implementing a Duplex Stream
-A [Duplex][] stream is one that implements both [Readable][] and [Writable][],
-such as a TCP socket connection.
+A [`Duplex`][] stream is one that implements both [`Readable`][] and
+[`Writable`][], such as a TCP socket connection.
Because JavaScript does not have support for multiple inheritance, the
-`stream.Duplex` class is extended to implement a [Duplex][] stream (as opposed
+`stream.Duplex` class is extended to implement a [`Duplex`][] stream (as opposed
to extending the `stream.Readable` *and* `stream.Writable` classes).
The `stream.Duplex` class prototypically inherits from `stream.Readable` and
@@ -2034,7 +2036,7 @@ parasitically from `stream.Writable`, but `instanceof` will work properly for
both base classes due to overriding [`Symbol.hasInstance`][] on
`stream.Writable`.
-Custom Duplex streams *must* call the `new stream.Duplex([options])`
+Custom `Duplex` streams *must* call the `new stream.Duplex([options])`
constructor and implement *both* the `readable._read()` and
`writable._write()` methods.
@@ -2047,7 +2049,7 @@ changes:
are supported now.
-->
-* `options` {Object} Passed to both Writable and Readable
+* `options` {Object} Passed to both `Writable` and `Readable`
constructors. Also has the following fields:
* `allowHalfOpen` {boolean} If set to `false`, then the stream will
automatically end the writable side when the readable side ends.
@@ -2103,13 +2105,13 @@ const myDuplex = new Duplex({
#### An Example Duplex Stream
-The following illustrates a simple example of a Duplex stream that wraps a
+The following illustrates a simple example of a `Duplex` stream that wraps a
hypothetical lower-level source object to which data can be written, and
from which data can be read, albeit using an API that is not compatible with
Node.js streams.
-The following illustrates a simple example of a Duplex stream that buffers
-incoming written data via the [Writable][] interface that is read back out
-via the [Readable][] interface.
+The following illustrates a simple example of a `Duplex` stream that buffers
+incoming written data via the [`Writable`][] interface that is read back out
+via the [`Readable`][] interface.
```js
const { Duplex } = require('stream');
@@ -2137,20 +2139,20 @@ class MyDuplex extends Duplex {
}
```
-The most important aspect of a Duplex stream is that the Readable and Writable
-sides operate independently of one another despite co-existing within a single
-object instance.
+The most important aspect of a `Duplex` stream is that the `Readable` and
+`Writable` sides operate independently of one another despite co-existing within
+a single object instance.
#### Object Mode Duplex Streams
-For Duplex streams, `objectMode` can be set exclusively for either the Readable
-or Writable side using the `readableObjectMode` and `writableObjectMode` options
-respectively.
+For `Duplex` streams, `objectMode` can be set exclusively for either the
+`Readable` or `Writable` side using the `readableObjectMode` and
+`writableObjectMode` options respectively.
-In the following example, for instance, a new Transform stream (which is a
-type of [Duplex][] stream) is created that has an object mode Writable side
+In the following example, for instance, a new `Transform` stream (which is a
+type of [`Duplex`][] stream) is created that has an object mode `Writable` side
that accepts JavaScript numbers that are converted to hexadecimal strings on
-the Readable side.
+the `Readable` side.
```js
const { Transform } = require('stream');
@@ -2184,31 +2186,31 @@ myTransform.write(100);
### Implementing a Transform Stream
-A [Transform][] stream is a [Duplex][] stream where the output is computed
+A [`Transform`][] stream is a [`Duplex`][] stream where the output is computed
in some way from the input. Examples include [zlib][] streams or [crypto][]
streams that compress, encrypt, or decrypt data.
There is no requirement that the output be the same size as the input, the same
-number of chunks, or arrive at the same time. For example, a Hash stream will
+number of chunks, or arrive at the same time. For example, a `Hash` stream will
only ever have a single chunk of output which is provided when the input is
ended. A `zlib` stream will produce output that is either much smaller or much
larger than its input.
-The `stream.Transform` class is extended to implement a [Transform][] stream.
+The `stream.Transform` class is extended to implement a [`Transform`][] stream.
The `stream.Transform` class prototypically inherits from `stream.Duplex` and
implements its own versions of the `writable._write()` and `readable._read()`
-methods. Custom Transform implementations *must* implement the
+methods. Custom `Transform` implementations *must* implement the
[`transform._transform()`][stream-_transform] method and *may* also implement
the [`transform._flush()`][stream-_flush] method.
-Care must be taken when using Transform streams in that data written to the
-stream can cause the Writable side of the stream to become paused if the output
-on the Readable side is not consumed.
+Care must be taken when using `Transform` streams in that data written to the
+stream can cause the `Writable` side of the stream to become paused if the
+output on the `Readable` side is not consumed.
#### new stream.Transform([options])
-* `options` {Object} Passed to both Writable and Readable
+* `options` {Object} Passed to both `Writable` and `Readable`
constructors. Also has the following fields:
* `transform` {Function} Implementation for the
[`stream._transform()`][stream-_transform] method.
@@ -2267,8 +2269,8 @@ after all data has been output, which occurs after the callback in
argument and data) to be called when remaining data has been flushed.
This function MUST NOT be called by application code directly. It should be
-implemented by child classes, and called by the internal Readable class methods
-only.
+implemented by child classes, and called by the internal `Readable` class
+methods only.
In some cases, a transform operation may need to emit an additional bit of
data at the end of the stream. For example, a `zlib` compression stream will
@@ -2276,10 +2278,10 @@ store an amount of internal state used to optimally compress the output. When
the stream ends, however, that additional data needs to be flushed so that the
compressed data will be complete.
-Custom [Transform][] implementations *may* implement the `transform._flush()`
+Custom [`Transform`][] implementations *may* implement the `transform._flush()`
method. This will be called when there is no more written data to be consumed,
but before the [`'end'`][] event is emitted signaling the end of the
-[Readable][] stream.
+[`Readable`][] stream.
Within the `transform._flush()` implementation, the `readable.push()` method
may be called zero or more times, as appropriate. The `callback` function must
@@ -2302,10 +2304,10 @@ user programs.
processed.
This function MUST NOT be called by application code directly. It should be
-implemented by child classes, and called by the internal Readable class methods
-only.
+implemented by child classes, and called by the internal `Readable` class
+methods only.
-All Transform stream implementations must provide a `_transform()`
+All `Transform` stream implementations must provide a `_transform()`
method to accept input and produce output. The `transform._transform()`
implementation handles the bytes being written, computes an output, then passes
that output off to the readable portion using the `readable.push()` method.
@@ -2343,7 +2345,7 @@ called, either synchronously or asynchronously.
#### Class: stream.PassThrough
-The `stream.PassThrough` class is a trivial implementation of a [Transform][]
+The `stream.PassThrough` class is a trivial implementation of a [`Transform`][]
stream that simply passes the input bytes across to the output. Its purpose is
primarily for examples and testing, but there are some use cases where
`stream.PassThrough` is useful as a building block for novel sorts of streams.
@@ -2356,7 +2358,7 @@ primarily for examples and testing, but there are some use cases where
-In versions of Node.js prior to v0.10, the Readable stream interface was
+In versions of Node.js prior to v0.10, the `Readable` stream interface was
simpler, but also less powerful and less useful.
* Rather than waiting for calls the [`stream.read()`][stream-read] method,
@@ -2367,9 +2369,9 @@ simpler, but also less powerful and less useful.
guaranteed. This meant that it was still necessary to be prepared to receive
[`'data'`][] events *even when the stream was in a paused state*.
-In Node.js v0.10, the [Readable][] class was added. For backwards compatibility
-with older Node.js programs, Readable streams switch into "flowing mode" when a
-[`'data'`][] event handler is added, or when the
+In Node.js v0.10, the [`Readable`][] class was added. For backwards
+compatibility with older Node.js programs, `Readable` streams switch into
+"flowing mode" when a [`'data'`][] event handler is added, or when the
[`stream.resume()`][stream-resume] method is called. The effect is that, even
when not using the new [`stream.read()`][stream-read] method and
[`'readable'`][] event, it is no longer necessary to worry about losing
@@ -2407,22 +2409,19 @@ The workaround in this situation is to call the
```js
// Workaround
net.createServer((socket) => {
-
socket.on('end', () => {
socket.end('The message was received but was not processed.\n');
});
// start the flow of data, discarding it.
socket.resume();
-
}).listen(1337);
```
-In addition to new Readable streams switching into flowing mode,
-pre-v0.10 style streams can be wrapped in a Readable class using the
+In addition to new `Readable` streams switching into flowing mode,
+pre-v0.10 style streams can be wrapped in a `Readable` class using the
[`readable.wrap()`][`stream.wrap()`] method.
-
### `readable.read(0)`
There are some cases where it is necessary to trigger a refresh of the
@@ -2436,7 +2435,7 @@ a low-level [`stream._read()`][stream-_read] call.
While most applications will almost never need to do this, there are
situations within Node.js where this is done, particularly in the
-Readable stream class internals.
+`Readable` stream class internals.
### `readable.push('')`
@@ -2486,13 +2485,13 @@ contain multi-byte characters.
[API for Stream Consumers]: #stream_api_for_stream_consumers
[API for Stream Implementers]: #stream_api_for_stream_implementers
[Compatibility]: #stream_compatibility_with_older_node_js_versions
-[Duplex]: #stream_class_stream_duplex
+[`Duplex`]: #stream_class_stream_duplex
[HTTP requests, on the client]: http.html#http_class_http_clientrequest
[HTTP responses, on the server]: http.html#http_class_http_serverresponse
-[Readable]: #stream_class_stream_readable
+[`Readable`]: #stream_class_stream_readable
[TCP sockets]: net.html#net_class_net_socket
-[Transform]: #stream_class_stream_transform
-[Writable]: #stream_class_stream_writable
+[`Transform`]: #stream_class_stream_transform
+[`Writable`]: #stream_class_stream_writable
[child process stdin]: child_process.html#child_process_subprocess_stdin
[child process stdout and stderr]: child_process.html#child_process_subprocess_stdout
[crypto]: crypto.html
diff --git a/doc/api/synopsis.md b/doc/api/synopsis.md
index 508dde1ff483f8..ad14fae7b8d791 100644
--- a/doc/api/synopsis.md
+++ b/doc/api/synopsis.md
@@ -88,9 +88,9 @@ $ node hello-world.js
An output like this should appear in the terminal to indicate Node.js
server is running:
- ```console
- Server running at http://127.0.0.1:3000/
- ````
+```console
+Server running at http://127.0.0.1:3000/
+```
Now, open any preferred web browser and visit `http://127.0.0.1:3000`.
diff --git a/doc/api/timers.md b/doc/api/timers.md
index 0cc535352a0697..376b5312e5a41a 100644
--- a/doc/api/timers.md
+++ b/doc/api/timers.md
@@ -28,7 +28,7 @@ functions that can be used to control this default behavior.
added: v9.7.0
-->
-* Returns: {Immediate}
+* Returns: {Immediate} a reference to `immediate`
When called, requests that the Node.js event loop *not* exit so long as the
`Immediate` is active. Calling `immediate.ref()` multiple times will have no
@@ -37,22 +37,18 @@ effect.
By default, all `Immediate` objects are "ref'ed", making it normally unnecessary
to call `immediate.ref()` unless `immediate.unref()` had been called previously.
-Returns a reference to the `Immediate`.
-
### immediate.unref()
-* Returns: {Immediate}
+* Returns: {Immediate} a reference to `immediate`
When called, the active `Immediate` object will not require the Node.js event
loop to remain active. If there is no other activity keeping the event loop
running, the process may exit before the `Immediate` object's callback is
invoked. Calling `immediate.unref()` multiple times will have no effect.
-Returns a reference to the `Immediate`.
-
## Class: Timeout
This object is created internally and is returned from [`setTimeout()`][] and
@@ -70,7 +66,7 @@ control this default behavior.
added: v0.9.1
-->
-* Returns: {Timeout}
+* Returns: {Timeout} a reference to `timeout`
When called, requests that the Node.js event loop *not* exit so long as the
`Timeout` is active. Calling `timeout.ref()` multiple times will have no effect.
@@ -78,14 +74,12 @@ When called, requests that the Node.js event loop *not* exit so long as the
By default, all `Timeout` objects are "ref'ed", making it normally unnecessary
to call `timeout.ref()` unless `timeout.unref()` had been called previously.
-Returns a reference to the `Timeout`.
-
### timeout.unref()
-* Returns: {Timeout}
+* Returns: {Timeout} a reference to `timeout`
When called, the active `Timeout` object will not require the Node.js event loop
to remain active. If there is no other activity keeping the event loop running,
@@ -96,8 +90,6 @@ Calling `timeout.unref()` creates an internal timer that will wake the Node.js
event loop. Creating too many of these can adversely impact performance
of the Node.js application.
-Returns a reference to the `Timeout`.
-
## Scheduling Timers
A timer in Node.js is an internal construct that calls a given function after
@@ -113,9 +105,10 @@ added: v0.9.1
* `callback` {Function} The function to call at the end of this turn of
[the Node.js Event Loop]
* `...args` {any} Optional arguments to pass when the `callback` is called.
+* Returns: {Immediate} for use with [`clearImmediate()`][]
Schedules the "immediate" execution of the `callback` after I/O events'
-callbacks. Returns an `Immediate` for use with [`clearImmediate()`][].
+callbacks.
When multiple calls to `setImmediate()` are made, the `callback` functions are
queued for execution in the order in which they are created. The entire callback
@@ -155,10 +148,9 @@ added: v0.0.1
* `delay` {number} The number of milliseconds to wait before calling the
`callback`.
* `...args` {any} Optional arguments to pass when the `callback` is called.
-* Returns: {Timeout}
+* Returns: {Timeout} for use with [`clearInterval()`][]
Schedules repeated execution of `callback` every `delay` milliseconds.
-Returns a `Timeout` for use with [`clearInterval()`][].
When `delay` is larger than `2147483647` or less than `1`, the `delay` will be
set to `1`.
@@ -174,10 +166,9 @@ added: v0.0.1
* `delay` {number} The number of milliseconds to wait before calling the
`callback`.
* `...args` {any} Optional arguments to pass when the `callback` is called.
-* Returns: {Timeout}
+* Returns: {Timeout} for use with [`clearTimeout()`][]
Schedules execution of a one-time `callback` after `delay` milliseconds.
-Returns a `Timeout` for use with [`clearTimeout()`][].
The `callback` will likely not be invoked in precisely `delay` milliseconds.
Node.js makes no guarantees about the exact timing of when callbacks will fire,
@@ -239,7 +230,6 @@ added: v0.0.1
Cancels a `Timeout` object created by [`setTimeout()`][].
-
[`TypeError`]: errors.html#errors_class_typeerror
[`clearImmediate()`]: timers.html#timers_clearimmediate_immediate
[`clearInterval()`]: timers.html#timers_clearinterval_timeout
diff --git a/doc/api/tls.md b/doc/api/tls.md
index 0f9e46f2474d57..e22286adb45ad3 100644
--- a/doc/api/tls.md
+++ b/doc/api/tls.md
@@ -404,7 +404,7 @@ added: v3.0.0
* Returns: {Buffer}
Returns a `Buffer` instance holding the keys currently used for
-encryption/decryption of the [TLS Session Tickets][]
+encryption/decryption of the [TLS Session Tickets][].
### server.listen()
@@ -422,13 +422,11 @@ added: v3.0.0
Updates the keys for encryption/decryption of the [TLS Session Tickets][].
The key's `Buffer` should be 48 bytes long. See `ticketKeys` option in
-[tls.createServer](#tls_tls_createserver_options_secureconnectionlistener) for
-more information on how it is used.
+[`tls.createServer()`] for more information on how it is used.
Changes to the ticket keys are effective only for future server connections.
Existing or currently pending server connections will use the previous keys.
-
## Class: tls.TLSSocket
-The `tty.WriteStream` class is a subclass of `net.Socket` that represents the
-writable side of a TTY. In normal circumstances, [`process.stdout`][] and
+The `tty.WriteStream` class is a subclass of [`net.Socket`][] that represents
+the writable side of a TTY. In normal circumstances, [`process.stdout`][] and
[`process.stderr`][] will be the only `tty.WriteStream` instances created for a
Node.js process and there should be no reason to create additional instances.
@@ -126,15 +126,15 @@ is updated whenever the `'resize'` event is emitted.
added: v9.9.0
-->
-* `env` {Object} A object containing the environment variables to check.
+* `env` {Object} An object containing the environment variables to check.
**Default:** `process.env`.
* Returns: {number}
Returns:
-* 1 for 2,
-* 4 for 16,
-* 8 for 256,
-* 24 for 16,777,216
+* `1` for 2,
+* `4` for 16,
+* `8` for 256,
+* `24` for 16,777,216
colors supported.
Use this to determine what colors the terminal supports. Due to the nature of
diff --git a/doc/api/url.md b/doc/api/url.md
index 35a72da8ee681f..64b7b444c54ffd 100644
--- a/doc/api/url.md
+++ b/doc/api/url.md
@@ -86,8 +86,8 @@ The `URL` class is also available on the global object.
In accordance with browser conventions, all properties of `URL` objects
are implemented as getters and setters on the class prototype, rather than as
-data properties on the object itself. Thus, unlike [legacy urlObject][]s, using
-the `delete` keyword on any properties of `URL` objects (e.g. `delete
+data properties on the object itself. Thus, unlike [legacy `urlObject`][]s,
+using the `delete` keyword on any properties of `URL` objects (e.g. `delete
myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still
return `true`.
@@ -132,8 +132,6 @@ and a `base` is provided, it is advised to validate that the `origin` of
the `URL` object is what is expected.
```js
-const { URL } = require('url');
-
let myURL = new URL('http://anotherExample.org/', 'https://example.org/');
// http://anotherexample.org/
@@ -348,7 +346,7 @@ console.log(myURL.port);
// Prints 1234
```
-The port value may be set as either a number or as a String containing a number
+The port value may be set as either a number or as a string containing a number
in the range `0` to `65535` (inclusive). Setting the value to the default port
of the `URL` objects given `protocol` will result in the `port` value becoming
the empty string (`''`).
@@ -583,7 +581,7 @@ added: v7.10.0
* `iterable` {Iterable} An iterable object whose elements are key-value pairs
Instantiate a new `URLSearchParams` object with an iterable map in a way that
-is similar to [`Map`][]'s constructor. `iterable` can be an Array or any
+is similar to [`Map`][]'s constructor. `iterable` can be an `Array` or any
iterable object. That means `iterable` can be another `URLSearchParams`, in
which case the constructor will simply create a clone of the provided
`URLSearchParams`. Elements of `iterable` are key-value pairs, and can
@@ -646,16 +644,16 @@ Remove all name-value pairs whose name is `name`.
* Returns: {Iterator}
-Returns an ES6 Iterator over each of the name-value pairs in the query.
-Each item of the iterator is a JavaScript Array. The first item of the Array
-is the `name`, the second item of the Array is the `value`.
+Returns an ES6 `Iterator` over each of the name-value pairs in the query.
+Each item of the iterator is a JavaScript `Array`. The first item of the `Array`
+is the `name`, the second item of the `Array` is the `value`.
Alias for [`urlSearchParams[@@iterator]()`][`urlSearchParams@@iterator()`].
#### urlSearchParams.forEach(fn[, thisArg])
-* `fn` {Function} Function invoked for each name-value pair in the query.
-* `thisArg` {Object} Object to be used as `this` value for when `fn` is called
+* `fn` {Function} Invoked for each name-value pair in the query
+* `thisArg` {Object} To be used as `this` value for when `fn` is called
Iterates over each name-value pair in the query and invokes the given function.
@@ -697,7 +695,7 @@ Returns `true` if there is at least one name-value pair whose name is `name`.
* Returns: {Iterator}
-Returns an ES6 Iterator over the names of each name-value pair.
+Returns an ES6 `Iterator` over the names of each name-value pair.
```js
const params = new URLSearchParams('foo=bar&foo=baz');
@@ -762,15 +760,15 @@ percent-encoded where necessary.
* Returns: {Iterator}
-Returns an ES6 Iterator over the values of each name-value pair.
+Returns an ES6 `Iterator` over the values of each name-value pair.
#### urlSearchParams\[Symbol.iterator\]()
* Returns: {Iterator}
-Returns an ES6 Iterator over each of the name-value pairs in the query string.
-Each item of the iterator is a JavaScript Array. The first item of the Array
-is the `name`, the second item of the Array is the `value`.
+Returns an ES6 `Iterator` over each of the name-value pairs in the query string.
+Each item of the iterator is a JavaScript `Array`. The first item of the `Array`
+is the `name`, the second item of the `Array` is the `value`.
Alias for [`urlSearchParams.entries()`][].
@@ -848,7 +846,7 @@ added: v7.6.0
Punycode encoded. **Default:** `false`.
* Returns: {string}
-Returns a customizable serialization of a URL String representation of a
+Returns a customizable serialization of a URL `String` representation of a
[WHATWG URL][] object.
The URL object has both a `toString()` method and `href` property that return
@@ -873,9 +871,9 @@ console.log(url.format(myURL, { fragment: false, unicode: true, auth: false }));
## Legacy URL API
-### Legacy urlObject
+### Legacy `urlObject`
-The legacy urlObject (`require('url').Url`) is created and returned by the
+The legacy `urlObject` (`require('url').Url`) is created and returned by the
`url.parse()` function.
#### urlObject.auth
@@ -886,42 +884,42 @@ double slashes (if present) and precedes the `host` component, delimited by an
ASCII "at sign" (`@`). The format of the string is `{username}[:{password}]`,
with the `[:{password}]` portion being optional.
-For example: `'user:pass'`
+For example: `'user:pass'`.
#### urlObject.hash
The `hash` property consists of the "fragment" portion of the URL including
the leading ASCII hash (`#`) character.
-For example: `'#hash'`
+For example: `'#hash'`.
#### urlObject.host
The `host` property is the full lower-cased host portion of the URL, including
the `port` if specified.
-For example: `'sub.host.com:8080'`
+For example: `'sub.host.com:8080'`.
#### urlObject.hostname
The `hostname` property is the lower-cased host name portion of the `host`
component *without* the `port` included.
-For example: `'sub.host.com'`
+For example: `'sub.host.com'`.
#### urlObject.href
The `href` property is the full URL string that was parsed with both the
`protocol` and `host` components converted to lower-case.
-For example: `'http://user:pass@sub.host.com:8080/p/a/t/h?query=string#hash'`
+For example: `'http://user:pass@sub.host.com:8080/p/a/t/h?query=string#hash'`.
#### urlObject.path
The `path` property is a concatenation of the `pathname` and `search`
components.
-For example: `'/p/a/t/h?query=string'`
+For example: `'/p/a/t/h?query=string'`.
No decoding of the `path` is performed.
@@ -932,7 +930,7 @@ is everything following the `host` (including the `port`) and before the start
of the `query` or `hash` components, delimited by either the ASCII question
mark (`?`) or hash (`#`) characters.
-For example `'/p/a/t/h'`
+For example `'/p/a/t/h'`.
No decoding of the path string is performed.
@@ -940,13 +938,13 @@ No decoding of the path string is performed.
The `port` property is the numeric port portion of the `host` component.
-For example: `'8080'`
+For example: `'8080'`.
#### urlObject.protocol
The `protocol` property identifies the URL's lower-cased protocol scheme.
-For example: `'http:'`
+For example: `'http:'`.
#### urlObject.query
@@ -955,7 +953,7 @@ question mark (`?`), or an object returned by the [`querystring`][] module's
`parse()` method. Whether the `query` property is a string or object is
determined by the `parseQueryString` argument passed to `url.parse()`.
-For example: `'query=string'` or `{'query': 'string'}`
+For example: `'query=string'` or `{'query': 'string'}`.
If returned as a string, no decoding of the query string is performed. If
returned as an object, both keys and values are decoded.
@@ -965,7 +963,7 @@ returned as an object, both keys and values are decoded.
The `search` property consists of the entire "query string" portion of the
URL, including the leading ASCII question mark (`?`) character.
-For example: `'?query=string'`
+For example: `'?query=string'`.
No decoding of the query string is performed.
@@ -1041,7 +1039,7 @@ The formatting process operates as follows:
`urlObject.host` is coerced to a string and appended to `result`.
* If the `urlObject.pathname` property is a string that is not an empty string:
* If the `urlObject.pathname` *does not start* with an ASCII forward slash
- (`/`), then the literal string '/' is appended to `result`.
+ (`/`), then the literal string `'/'` is appended to `result`.
* The value of `urlObject.pathname` is appended to `result`.
* Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an
[`Error`][] is thrown.
@@ -1063,7 +1061,6 @@ The formatting process operates as follows:
string, an [`Error`][] is thrown.
* `result` is returned.
-
### url.parse(urlString[, parseQueryString[, slashesDenoteHost]])
-* `object` {any} Any JavaScript primitive or Object.
+* `object` {any} Any JavaScript primitive or `Object`.
* `options` {Object}
* `showHidden` {boolean} If `true`, the `object`'s non-enumerable symbols and
properties will be included in the formatted result as well as [`WeakMap`][]
@@ -623,7 +623,7 @@ util.inspect(obj);
added: v6.6.0
-->
-A Symbol that can be used to declare custom inspect functions, see
+A {symbol} that can be used to declare custom inspect functions, see
[Custom inspection functions on Objects][].
### util.inspect.defaultOptions
@@ -670,7 +670,7 @@ added: v8.0.0
* Returns: {Function}
Takes a function following the common error-first callback style, i.e. taking
-a `(err, value) => ...` callback as the last argument, and returns a version
+an `(err, value) => ...` callback as the last argument, and returns a version
that returns promises.
```js
@@ -752,7 +752,7 @@ added: v8.0.0
* {symbol}
-A Symbol that can be used to declare custom promisified variants of functions,
+A {symbol} that can be used to declare custom promisified variants of functions,
see [Custom promisified functions][].
## Class: util.TextDecoder
@@ -859,7 +859,7 @@ supported encodings or an alias.
### textDecoder.decode([input[, options]])
* `input` {ArrayBuffer|DataView|TypedArray} An `ArrayBuffer`, `DataView` or
- Typed Array instance containing the encoded data.
+ `Typed Array` instance containing the encoded data.
* `options` {Object}
* `stream` {boolean} `true` if additional chunks of data are expected.
**Default:** `false`.
@@ -1537,7 +1537,6 @@ const module = new WebAssembly.Module(wasmBuffer);
util.types.isWebAssemblyCompiledModule(module); // Returns true
```
-
## Deprecated APIs
The following APIs have been deprecated and should no longer be used. Existing
diff --git a/doc/api/vm.md b/doc/api/vm.md
index 75fb03642cc6b7..9e1249dc4ed8bb 100644
--- a/doc/api/vm.md
+++ b/doc/api/vm.md
@@ -162,20 +162,20 @@ const contextifiedSandbox = vm.createContext({ secret: 42 });
* `url` {string} URL used in module resolution and stack traces. **Default:**
`'vm:module(i)'` where `i` is a context-specific ascending index.
* `context` {Object} The [contextified][] object as returned by the
- `vm.createContext()` method, to compile and evaluate this Module in.
+ `vm.createContext()` method, to compile and evaluate this `Module` in.
* `lineOffset` {integer} Specifies the line number offset that is displayed
- in stack traces produced by this Module.
- * `columnOffset` {integer} Spcifies the column number offset that is displayed
- in stack traces produced by this Module.
- * `initalizeImportMeta` {Function} Called during evaluation of this Module to
- initialize the `import.meta`. This function has the signature `(meta,
- module)`, where `meta` is the `import.meta` object in the Module, and
+ in stack traces produced by this `Module`.
+ * `columnOffset` {integer} Specifies the column number offset that is
+ displayed in stack traces produced by this `Module`.
+ * `initalizeImportMeta` {Function} Called during evaluation of this `Module`
+ to initialize the `import.meta`. This function has the signature `(meta,
+ module)`, where `meta` is the `import.meta` object in the `Module`, and
`module` is this `vm.Module` object.
Creates a new ES `Module` object.
*Note*: Properties assigned to the `import.meta` object that are objects may
-allow the Module to access information outside the specified `context`, if the
+allow the `Module` to access information outside the specified `context`, if the
object is created in the top level context. Use `vm.runInContext()` to create
objects in a specific context.
@@ -217,8 +217,8 @@ const contextifiedSandbox = vm.createContext({ secret: 42 });
The specifiers of all dependencies of this module. The returned array is frozen
to disallow any changes to it.
-Corresponds to the [[RequestedModules]] field of [Source Text Module Record][]s
-in the ECMAScript specification.
+Corresponds to the `[[RequestedModules]]` field of
+[Source Text Module Record][]s in the ECMAScript specification.
### module.error
@@ -231,7 +231,7 @@ accessing this property will result in a thrown exception.
The value `undefined` cannot be used for cases where there is not a thrown
exception due to possible ambiguity with `throw undefined;`.
-Corresponds to the [[EvaluationError]] field of [Source Text Module Record][]s
+Corresponds to the `[[EvaluationError]]` field of [Source Text Module Record][]s
in the ECMAScript specification.
### module.linkingStatus
@@ -246,8 +246,8 @@ The current linking status of `module`. It will be one of the following values:
- `'linked'`: `module.link()` has been called, and all its dependencies have
been successfully linked.
- `'errored'`: `module.link()` has been called, but at least one of its
- dependencies failed to link, either because the callback returned a Promise
- that is rejected, or because the Module the callback returned is invalid.
+ dependencies failed to link, either because the callback returned a `Promise`
+ that is rejected, or because the `Module` the callback returned is invalid.
### module.namespace
@@ -289,9 +289,9 @@ The current status of the module. Will be one of:
- `'errored'`: The module has been evaluated, but an exception was thrown.
Other than `'errored'`, this status string corresponds to the specification's
-[Source Text Module Record][]'s [[Status]] field. `'errored'` corresponds to
-`'evaluated'` in the specification, but with [[EvaluationError]] set to a value
-that is not `undefined`.
+[Source Text Module Record][]'s `[[Status]]` field. `'errored'` corresponds to
+`'evaluated'` in the specification, but with `[[EvaluationError]]` set to a
+value that is not `undefined`.
### module.url
@@ -472,7 +472,6 @@ changes:
during script execution, but will continue to work after that.
If execution is terminated, an [`Error`][] will be thrown.
-
Runs the compiled code contained by the `vm.Script` object within the given
`contextifiedSandbox` and returns the result. Running code does not have access
to local scope.
@@ -868,7 +867,7 @@ const code = `
})`;
vm.runInThisContext(code)(require);
- ```
+```
The `require()` in the above case shares the state with the context it is
passed from. This may introduce risks when untrusted code is executed, e.g.
diff --git a/doc/api/zlib.md b/doc/api/zlib.md
index 1fe05f26ca3b5d..0e66abdcfb0766 100644
--- a/doc/api/zlib.md
+++ b/doc/api/zlib.md
@@ -165,7 +165,7 @@ The memory requirements for deflate are (in bytes):
(1 << (windowBits + 2)) + (1 << (memLevel + 9))
```
-That is: 128K for windowBits = 15 + 128K for memLevel = 8
+That is: 128K for `windowBits` = 15 + 128K for `memLevel` = 8
(default values) plus a few kilobytes for small objects.
For example, to reduce the default memory requirements from 256K to 128K, the
@@ -178,7 +178,7 @@ const options = { windowBits: 14, memLevel: 7 };
This will, however, generally degrade compression.
The memory requirements for inflate are (in bytes) `1 << windowBits`.
-That is, 32K for windowBits = 15 (default value) plus a few kilobytes
+That is, 32K for `windowBits` = 15 (default value) plus a few kilobytes
for small objects.
This is in addition to a single internal output slab buffer of size
@@ -287,10 +287,10 @@ added: v0.11.1
changes:
- version: v9.4.0
pr-url: https://github.com/nodejs/node/pull/16042
- description: The `dictionary` option can be an ArrayBuffer.
+ description: The `dictionary` option can be an `ArrayBuffer`.
- version: v8.0.0
pr-url: https://github.com/nodejs/node/pull/12001
- description: The `dictionary` option can be an Uint8Array now.
+ description: The `dictionary` option can be an `Uint8Array` now.
- version: v5.11.0
pr-url: https://github.com/nodejs/node/pull/6069
description: The `finishFlush` option is supported now.
@@ -312,7 +312,7 @@ ignored by the decompression classes.
* `strategy` {integer} (compression only)
* `dictionary` {Buffer|TypedArray|DataView|ArrayBuffer} (deflate/inflate only,
empty dictionary by default)
-* `info` {boolean} (If `true`, returns an object with `buffer` and `engine`)
+* `info` {boolean} (If `true`, returns an object with `buffer` and `engine`.)
See the description of `deflateInit2` and `inflateInit2` at
for more information on these.
@@ -473,17 +473,17 @@ Provides an object enumerating Zlib-related constants.
added: v0.5.8
-->
-Creates and returns a new [Deflate][] object with the given [`options`][].
+Creates and returns a new [`Deflate`][] object with the given [`options`][].
## zlib.createDeflateRaw([options])
-Creates and returns a new [DeflateRaw][] object with the given [`options`][].
+Creates and returns a new [`DeflateRaw`][] object with the given [`options`][].
-An upgrade of zlib from 1.2.8 to 1.2.11 changed behavior when windowBits
-is set to 8 for raw deflate streams. zlib would automatically set windowBits
+An upgrade of zlib from 1.2.8 to 1.2.11 changed behavior when `windowBits`
+is set to 8 for raw deflate streams. zlib would automatically set `windowBits`
to 9 if was initially set to 8. Newer versions of zlib will throw an exception,
so Node.js restored the original behavior of upgrading a value of 8 to 9,
since passing `windowBits = 9` to zlib actually results in a compressed stream
@@ -494,35 +494,35 @@ that effectively uses an 8-bit window only.
added: v0.5.8
-->
-Creates and returns a new [Gunzip][] object with the given [`options`][].
+Creates and returns a new [`Gunzip`][] object with the given [`options`][].
## zlib.createGzip([options])
-Creates and returns a new [Gzip][] object with the given [`options`][].
+Creates and returns a new [`Gzip`][] object with the given [`options`][].
## zlib.createInflate([options])
-Creates and returns a new [Inflate][] object with the given [`options`][].
+Creates and returns a new [`Inflate`][] object with the given [`options`][].
## zlib.createInflateRaw([options])
-Creates and returns a new [InflateRaw][] object with the given [`options`][].
+Creates and returns a new [`InflateRaw`][] object with the given [`options`][].
## zlib.createUnzip([options])
-Creates and returns a new [Unzip][] object with the given [`options`][].
+Creates and returns a new [`Unzip`][] object with the given [`options`][].
## Convenience Methods
@@ -542,13 +542,13 @@ added: v0.6.0
changes:
- version: v9.4.0
pr-url: https://github.com/nodejs/node/pull/16042
- description: The `buffer` parameter can be an ArrayBuffer.
+ description: The `buffer` parameter can be an `ArrayBuffer`.
- version: v8.0.0
pr-url: https://github.com/nodejs/node/pull/12223
- description: The `buffer` parameter can be any TypedArray or DataView now.
+ description: The `buffer` parameter can be any `TypedArray` or `DataView`.
- version: v8.0.0
pr-url: https://github.com/nodejs/node/pull/12001
- description: The `buffer` parameter can be an Uint8Array now.
+ description: The `buffer` parameter can be an `Uint8Array` now.
-->
### zlib.deflateSync(buffer[, options])
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
-Compress a chunk of data with [Deflate][].
+Compress a chunk of data with [`Deflate`][].
### zlib.deflateRaw(buffer[, options], callback)
### zlib.deflateRawSync(buffer[, options])
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
-Compress a chunk of data with [DeflateRaw][].
+Compress a chunk of data with [`DeflateRaw`][].
### zlib.gunzip(buffer[, options], callback)
### zlib.gunzipSync(buffer[, options])
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
-Decompress a chunk of data with [Gunzip][].
+Decompress a chunk of data with [`Gunzip`][].
### zlib.gzip(buffer[, options], callback)
### zlib.gzipSync(buffer[, options])
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
-Compress a chunk of data with [Gzip][].
+Compress a chunk of data with [`Gzip`][].
### zlib.inflate(buffer[, options], callback)
### zlib.inflateSync(buffer[, options])
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
-Decompress a chunk of data with [Inflate][].
+Decompress a chunk of data with [`Inflate`][].
### zlib.inflateRaw(buffer[, options], callback)
### zlib.inflateRawSync(buffer[, options])
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
-Decompress a chunk of data with [InflateRaw][].
+Decompress a chunk of data with [`InflateRaw`][].
### zlib.unzip(buffer[, options], callback)
### zlib.unzipSync(buffer[, options])
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
-Decompress a chunk of data with [Unzip][].
+Decompress a chunk of data with [`Unzip`][].
[`.flush()`]: #zlib_zlib_flush_kind_callback
[`Accept-Encoding`]: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3
@@ -770,16 +770,16 @@ Decompress a chunk of data with [Unzip][].
[`Buffer`]: buffer.html#buffer_class_buffer
[`Content-Encoding`]: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
[`DataView`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView
+[`Deflate`]: #zlib_class_zlib_deflate
+[`DeflateRaw`]: #zlib_class_zlib_deflateraw
+[`Gunzip`]: #zlib_class_zlib_gunzip
+[`Gzip`]: #zlib_class_zlib_gzip
+[`Inflate`]: #zlib_class_zlib_inflate
+[`InflateRaw`]: #zlib_class_zlib_inflateraw
[`TypedArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
-[`options`]: #zlib_class_options
-[DeflateRaw]: #zlib_class_zlib_deflateraw
-[Deflate]: #zlib_class_zlib_deflate
-[Gunzip]: #zlib_class_zlib_gunzip
-[Gzip]: #zlib_class_zlib_gzip
-[InflateRaw]: #zlib_class_zlib_inflateraw
-[Inflate]: #zlib_class_zlib_inflate
-[Memory Usage Tuning]: #zlib_memory_usage_tuning
-[Unzip]: #zlib_class_zlib_unzip
[`UV_THREADPOOL_SIZE`]: cli.html#cli_uv_threadpool_size_size
+[`Unzip`]: #zlib_class_zlib_unzip
+[`options`]: #zlib_class_options
[`zlib.bytesWritten`]: #zlib_zlib_byteswritten
+[Memory Usage Tuning]: #zlib_memory_usage_tuning
[zlib documentation]: https://zlib.net/manual.html#Constants
diff --git a/doc/changelogs/CHANGELOG_V10.md b/doc/changelogs/CHANGELOG_V10.md
index 1f027679b3bf83..48e757a5c452bc 100644
--- a/doc/changelogs/CHANGELOG_V10.md
+++ b/doc/changelogs/CHANGELOG_V10.md
@@ -9,6 +9,7 @@