From fb89be63beed8e6703c5f9f4f10cb84b00897d68 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 5 Sep 2020 06:41:16 -0700 Subject: [PATCH 01/73] doc: use correct Error type for EventEmitter.defaultMaxListener MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a bad value is assigned to EventEmitter.defaultMaxListener, a RangeError is thrown and not a TypeError. Update documentation to reflect this. PR-URL: https://github.com/nodejs/node/pull/35069 Reviewed-By: Daijiro Wachi Reviewed-By: Michaël Zasso Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca --- doc/api/events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/events.md b/doc/api/events.md index ed61072d8841fc..a772b5041adf99 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -333,7 +333,7 @@ By default, a maximum of `10` listeners can be registered for any single event. This limit can be changed for individual `EventEmitter` instances using the [`emitter.setMaxListeners(n)`][] method. To change the default for *all* `EventEmitter` instances, the `EventEmitter.defaultMaxListeners` -property can be used. If this value is not a positive number, a `TypeError` +property can be used. If this value is not a positive number, a `RangeError` is thrown. Take caution when setting the `EventEmitter.defaultMaxListeners` because the From 25f93f3ec3c373c04c0c90ecfc7e17d792aa5799 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sat, 5 Sep 2020 12:50:44 +0200 Subject: [PATCH 02/73] test: add more valid results to test-trace-atomics-wait The two starting `Atomics.wait()` operations are not ordered, but the test assumed a specific ordering because of the latency that comes with spinning up a Worker thread. Add variants of the existing potential valid results that account for the reverse ordering. Fixes: https://github.com/nodejs/node/issues/35059 PR-URL: https://github.com/nodejs/node/pull/35066 Reviewed-By: Richard Lau Reviewed-By: Rich Trott --- test/parallel/test-trace-atomics-wait.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-trace-atomics-wait.js b/test/parallel/test-trace-atomics-wait.js index d925ffbe6c2cd4..03b76791586d98 100644 --- a/test/parallel/test-trace-atomics-wait.js +++ b/test/parallel/test-trace-atomics-wait.js @@ -54,6 +54,11 @@ const expectedTimelines = [ [Thread 0] Atomics.wait(
+ 4, 0, inf) started [Thread 1] Atomics.wait(
+ 4, -1, inf) started [Thread 0] Atomics.wait(
+ 4, 0, inf) was woken up by another thread +[Thread 1] Atomics.wait(
+ 4, -1, inf) was woken up by another thread`, + `${begin} +[Thread 1] Atomics.wait(
+ 4, 0, inf) started +[Thread 0] Atomics.wait(
+ 4, -1, inf) started +[Thread 0] Atomics.wait(
+ 4, 0, inf) was woken up by another thread [Thread 1] Atomics.wait(
+ 4, -1, inf) was woken up by another thread`, `${begin} [Thread 0] Atomics.wait(
+ 4, 0, inf) started @@ -71,6 +76,12 @@ values mismatched`, [Thread 1] Atomics.wait(
+ 4, -1, inf) started [Thread 0] Atomics.wait(
+ 4, 0, inf) was woken up by another thread [Thread 1] Atomics.wait(
+ 4, -1, inf) did not wait because the \ +values mismatched`, + `${begin} +[Thread 1] Atomics.wait(
+ 4, 0, inf) started +[Thread 0] Atomics.wait(
+ 4, -1, inf) started +[Thread 0] Atomics.wait(
+ 4, 0, inf) was woken up by another thread +[Thread 1] Atomics.wait(
+ 4, -1, inf) did not wait because the \ values mismatched`, `${begin} [Thread 0] Atomics.wait(
+ 4, 0, inf) started @@ -78,7 +89,7 @@ values mismatched`, values mismatched [Thread 1] Atomics.wait(
+ 4, -1, inf) started [Thread 1] Atomics.wait(
+ 4, -1, inf) did not wait because the \ -values mismatched` +values mismatched`, ]; assert(expectedTimelines.includes(actualTimeline)); From f3c45a1cefc37821c6270a5e984073573db9970c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 7 Sep 2020 16:51:58 -0700 Subject: [PATCH 03/73] Revert "build: require "allow edits" to be checked" This reverts commit 07423b5472c27d86b4b8047d150d75756ad01f3c. Refs: https://github.com/nodejs/node/pull/35002#issuecomment-688363345 PR-URL: https://github.com/nodejs/node/pull/35094 Reviewed-By: Mary Marchini Reviewed-By: Richard Lau --- .github/workflows/require-allow-edits.yml | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 .github/workflows/require-allow-edits.yml diff --git a/.github/workflows/require-allow-edits.yml b/.github/workflows/require-allow-edits.yml deleted file mode 100644 index 31a3d24efb423d..00000000000000 --- a/.github/workflows/require-allow-edits.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Require “Allow Edits” - -on: [pull_request] - -jobs: - _: - name: "Require “Allow Edits”" - - runs-on: ubuntu-latest - - steps: - - uses: ljharb/require-allow-edits@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 9faaa659b229359648c00bdc94681df95197f73f Mon Sep 17 00:00:00 2001 From: Leko Date: Mon, 7 Sep 2020 01:08:14 +0800 Subject: [PATCH 04/73] test: separate the test fixtures between ICU and URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We need to emit dependency of ICU's toASCII in order to update the WPT fixtures. Since ICU and URL isn't the same implementation and they also follow different specifications. ICU's toASCII shouldn't have a dependency on WPT fixtures. Refs: https://github.com/nodejs/node/pull/33770#issuecomment-680853608 PR-URL: https://github.com/nodejs/node/pull/35077 Reviewed-By: Daijiro Wachi Reviewed-By: Michaël Zasso Reviewed-By: Joyee Cheung --- test/fixtures/icu-punycode-toascii.json | 149 ++++++++++++++++++++++++ test/parallel/test-icu-punycode.js | 7 +- 2 files changed, 151 insertions(+), 5 deletions(-) create mode 100644 test/fixtures/icu-punycode-toascii.json diff --git a/test/fixtures/icu-punycode-toascii.json b/test/fixtures/icu-punycode-toascii.json new file mode 100644 index 00000000000000..814f06e794866d --- /dev/null +++ b/test/fixtures/icu-punycode-toascii.json @@ -0,0 +1,149 @@ +[ + "This resource is focused on highlighting issues with UTS #46 ToASCII", + { + "comment": "Label with hyphens in 3rd and 4th position", + "input": "aa--", + "output": "aa--" + }, + { + "input": "a†--", + "output": "xn--a---kp0a" + }, + { + "input": "ab--c", + "output": "ab--c" + }, + { + "comment": "Label with leading hyphen", + "input": "-x", + "output": "-x" + }, + { + "input": "-†", + "output": "xn----xhn" + }, + { + "input": "-x.xn--nxa", + "output": "-x.xn--nxa" + }, + { + "input": "-x.β", + "output": "-x.xn--nxa" + }, + { + "comment": "Label with trailing hyphen", + "input": "x-.xn--nxa", + "output": "x-.xn--nxa" + }, + { + "input": "x-.β", + "output": "x-.xn--nxa" + }, + { + "comment": "Empty labels", + "input": "x..xn--nxa", + "output": "x..xn--nxa" + }, + { + "input": "x..β", + "output": "x..xn--nxa" + }, + { + "comment": "Invalid Punycode", + "input": "xn--a", + "output": null + }, + { + "input": "xn--a.xn--nxa", + "output": null + }, + { + "input": "xn--a.β", + "output": null + }, + { + "comment": "Valid Punycode", + "input": "xn--nxa.xn--nxa", + "output": "xn--nxa.xn--nxa" + }, + { + "comment": "Mixed", + "input": "xn--nxa.β", + "output": "xn--nxa.xn--nxa" + }, + { + "input": "ab--c.xn--nxa", + "output": "ab--c.xn--nxa" + }, + { + "input": "ab--c.β", + "output": "ab--c.xn--nxa" + }, + { + "comment": "CheckJoiners is true", + "input": "\u200D.example", + "output": null + }, + { + "input": "xn--1ug.example", + "output": null + }, + { + "comment": "CheckBidi is true", + "input": "يa", + "output": null + }, + { + "input": "xn--a-yoc", + "output": null + }, + { + "comment": "processing_option is Nontransitional_Processing", + "input": "ශ්‍රී", + "output": "xn--10cl1a0b660p" + }, + { + "input": "نامه‌ای", + "output": "xn--mgba3gch31f060k" + }, + { + "comment": "U+FFFD", + "input": "\uFFFD.com", + "output": null + }, + { + "comment": "U+FFFD character encoded in Punycode", + "input": "xn--zn7c.com", + "output": null + }, + { + "comment": "Label longer than 63 code points", + "input": "x01234567890123456789012345678901234567890123456789012345678901x", + "output": "x01234567890123456789012345678901234567890123456789012345678901x" + }, + { + "input": "x01234567890123456789012345678901234567890123456789012345678901†", + "output": "xn--x01234567890123456789012345678901234567890123456789012345678901-6963b" + }, + { + "input": "x01234567890123456789012345678901234567890123456789012345678901x.xn--nxa", + "output": "x01234567890123456789012345678901234567890123456789012345678901x.xn--nxa" + }, + { + "input": "x01234567890123456789012345678901234567890123456789012345678901x.β", + "output": "x01234567890123456789012345678901234567890123456789012345678901x.xn--nxa" + }, + { + "comment": "Domain excluding TLD longer than 253 code points", + "input": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.x", + "output": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.x" + }, + { + "input": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.xn--nxa", + "output": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.xn--nxa" + }, + { + "input": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.β", + "output": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.xn--nxa" + } +] diff --git a/test/parallel/test-icu-punycode.js b/test/parallel/test-icu-punycode.js index 7595ffc4937c46..29e88f9b9a6262 100644 --- a/test/parallel/test-icu-punycode.js +++ b/test/parallel/test-icu-punycode.js @@ -16,10 +16,7 @@ assert(!icu.hasConverter('x'), 'hasConverter should report converter does not exist for x'); const tests = require('../fixtures/url-idna.js'); -const fixtures = require('../common/fixtures'); -const wptToASCIITests = require( - fixtures.path('wpt', 'url', 'resources', 'toascii.json') -); +const fixtures = require('../fixtures/icu-punycode-toascii.json'); { for (const [i, { ascii, unicode }] of tests.entries()) { @@ -33,7 +30,7 @@ const wptToASCIITests = require( } { - for (const [i, test] of wptToASCIITests.entries()) { + for (const [i, test] of fixtures.entries()) { if (typeof test === 'string') continue; // skip comments const { comment, input, output } = test; From 1cf9934e4ef8fc24cf15fed62af4d7f8eb078450 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 6 Sep 2020 15:33:16 -0700 Subject: [PATCH 05/73] doc: make minor improvements to module.md * sort references in ASCII order * replace abbreviation * split comma splice into two sentences and add appropriate punctuation * replace future tense with present tense PR-URL: https://github.com/nodejs/node/pull/35083 Reviewed-By: Geoffrey Booth Reviewed-By: Derek Lewis Reviewed-By: Daijiro Wachi --- doc/api/module.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/api/module.md b/doc/api/module.md index 383e7214b295ae..797c50b9d6e6b5 100644 --- a/doc/api/module.md +++ b/doc/api/module.md @@ -150,10 +150,10 @@ added: should be fetched. The `error` instance should be passed as the second parameter to `findSourceMap` -in exceptional flows, e.g., when an overridden +in exceptional flows, such as when an overridden [`Error.prepareStackTrace(error, trace)`][] is invoked. Modules are not added to -the module cache until they are successfully loaded, in these cases source maps -will be associated with the `error` instance along with the `path`. +the module cache until they are successfully loaded. In these cases, source maps +are associated with the `error` instance along with the `path`. ### Class: `module.SourceMap` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
123456
v6.xv6.14.2*
v8.xv8.6.0**v8.10.0*v8.11.2v8.16.0
v9.xv9.0.0*v9.3.0*v9.11.0*
v10.xv10.0.0v10.0.0v10.0.0v10.16.0v10.17.0v10.20.0
v11.xv11.0.0v11.0.0v11.0.0v11.8.0
v12.xv12.0.0v12.0.0v12.0.0v12.0.0v12.11.0v12.17.0
v13.xv13.0.0v13.0.0v13.0.0v13.0.0v13.0.0
v14.xv14.0.0v14.0.0v14.0.0v14.0.0v14.0.0v14.0.0
\* N-API was experimental. From ae85228e54cad6f1ab002db51d50cc8d37f654c3 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 11 Sep 2020 04:17:39 -0700 Subject: [PATCH 33/73] doc: perform minor cleanup on cli.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * sort references in ASCII order * merge logically-connected single-sentence paragraphs * remove _please_ from referrals to other docs * remove unnecessary italics * make some text more concise * change some instances of future tense to present tense PR-URL: https://github.com/nodejs/node/pull/35152 Reviewed-By: Michaël Zasso Reviewed-By: Anna Henningsen Reviewed-By: Daijiro Wachi --- doc/api/cli.md | 58 ++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index a3125de072b604..9f9a07056f0600 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -18,7 +18,7 @@ To view this documentation as a manual page in a terminal, run `man node`. Execute without arguments to start the [REPL][]. -_For more info about `node inspect`, please see the [debugger][] documentation._ +For more info about `node inspect`, see the [debugger][] documentation. ## Options All options, including V8 options, allow words to be separated by both -dashes (`-`) or underscores (`_`). +dashes (`-`) or underscores (`_`). For example, `--pending-deprecation` is +equivalent to `--pending_deprecation`. -For example, `--pending-deprecation` is equivalent to `--pending_deprecation`. - -If an option that takes a single value, for example `--max-http-header-size`, -is passed more than once, then the last passed value will be used. Options -from the command line take precedence over options passed through the -[`NODE_OPTIONS`][] environment variable. +If an option that takes a single value (such as `--max-http-header-size`) is +passed more than once, then the last passed value is used. Options from the +command line take precedence over options passed through the [`NODE_OPTIONS`][] +environment variable. ### `-` Alias for stdin. Analogous to the use of `-` in other command line utilities, -meaning that the script will be read from stdin, and the rest of the options +meaning that the script is read from stdin, and the rest of the options are passed to that script. ### `--` @@ -55,7 +54,7 @@ added: v6.11.0 Indicate the end of node options. Pass the rest of the arguments to the script. If no script filename or eval/print script is supplied prior to this, then -the next argument will be used as a script filename. +the next argument is used as a script filename. ### `--abort-on-uncaught-exception` Disable the `Object.prototype.__proto__` property. If `mode` is `delete`, the -property will be removed entirely. If `mode` is `throw`, accesses to the -property will throw an exception with the code `ERR_PROTO_ACCESS`. +property is removed entirely. If `mode` is `throw`, accesses to the +property throw an exception with the code `ERR_PROTO_ACCESS`. ### `--disallow-code-generation-from-strings` * `src` {string|Buffer|URL} source filename to copy @@ -1696,6 +1701,11 @@ fs.copyFile('source.txt', 'destination.txt', COPYFILE_EXCL, callback); ## `fs.copyFileSync(src, dest[, mode])` * `src` {string|Buffer|URL} source filename to copy @@ -4991,6 +5001,11 @@ upon success. ### `fsPromises.copyFile(src, dest[, mode])` * `src` {string|Buffer|URL} source filename to copy From 176e9e4054eec37018c908e64f5ece6aa3889924 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 13 Sep 2020 22:03:37 -0700 Subject: [PATCH 39/73] doc: fix broken links in modules.md PR-URL: https://github.com/nodejs/node/pull/35182 Reviewed-By: Guy Bedford Reviewed-By: Geoffrey Booth Reviewed-By: Derek Lewis Reviewed-By: Zeyu Yang Reviewed-By: Luigi Pinca --- doc/api/modules.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/modules.md b/doc/api/modules.md index 409182a0565203..e287a5846826d2 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -952,7 +952,7 @@ in order to be used. ## The `Module` object This section was moved to -[Modules: `module` core module](modules_module.html#modules_module_the_module_object). +[Modules: `module` core module](module.html#module_the_module_object). * `module.builtinModules` @@ -963,7 +963,7 @@ This section was moved to ## Source map v3 support This section was moved to -[Modules: `module` core module](modules_module.html#modules_module_source_map_v3_support). +[Modules: `module` core module](module.html#module_source_map_v3_support). * `module.findSourceMap(path[, error])` From 32d1731ae1ebad8d1a91f41ccd3f368aad406c1a Mon Sep 17 00:00:00 2001 From: schamberg97 <50446906+schamberg97@users.noreply.github.com> Date: Sat, 12 Sep 2020 12:47:45 +0300 Subject: [PATCH 40/73] doc: update process.release `process.release` documentation is out of date. This commit makes it up to date. PR-URL: https://github.com/nodejs/node/pull/35167 Reviewed-By: Richard Lau Reviewed-By: Gireesh Punathil Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott --- doc/api/process.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/doc/api/process.md b/doc/api/process.md index 0b51ef501f61bc..3c733b70c2bb42 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1768,19 +1768,22 @@ tarball. builds of Node.js and will be missing on all other platforms._ * `lts` {string} a string label identifying the [LTS][] label for this release. This property only exists for LTS releases and is `undefined` for all other - release types, including _Current_ releases. Currently the valid values are: - * `'Argon'` for the 4.x LTS line beginning with 4.2.0. - * `'Boron'` for the 6.x LTS line beginning with 6.9.0. - * `'Carbon'` for the 8.x LTS line beginning with 8.9.1. + release types, including _Current_ releases. + Valid values include the LTS Release Codenames (including those + that are no longer supported). A non-exhaustive example of + these codenames includes: + * `'Dubnium'` for the 10.x LTS line beginning with 10.13.0. + * `'Erbium'` for the 12.x LTS line beginning with 12.13.0. + For other LTS Release Codenames, see [Node.js Changelog Archive](https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_ARCHIVE.md) ```js { name: 'node', - lts: 'Argon', - sourceUrl: 'https://nodejs.org/download/release/v4.4.5/node-v4.4.5.tar.gz', - headersUrl: 'https://nodejs.org/download/release/v4.4.5/node-v4.4.5-headers.tar.gz', - libUrl: 'https://nodejs.org/download/release/v4.4.5/win-x64/node.lib' + lts: 'Erbium', + sourceUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1.tar.gz', + headersUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1-headers.tar.gz', + libUrl: 'https://nodejs.org/download/release/v12.18.1/win-x64/node.lib' } ``` From aea3f77c8d5c2b7793cefdc0120afe59f241453b Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 11 Sep 2020 16:24:06 +0200 Subject: [PATCH 41/73] doc: update eventLoopUtilization documentation PR-URL: https://github.com/nodejs/node/pull/35155 Reviewed-By: James M Snell Reviewed-By: Rich Trott --- doc/api/perf_hooks.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md index 60d2093c19b1b0..67f791653f9421 100644 --- a/doc/api/perf_hooks.md +++ b/doc/api/perf_hooks.md @@ -53,13 +53,13 @@ added: v8.5.0 If `name` is not provided, removes all `PerformanceMark` objects from the Performance Timeline. If `name` is provided, removes only the named mark. -### `performance.eventLoopUtilization([util1][,util2])` +### `performance.eventLoopUtilization([utilization1[, utilization2]])` -* `util1` {Object} The result of a previous call to `eventLoopUtilization()` -* `util2` {Object} The result of a previous call to `eventLoopUtilization()` +* `utilization1` {Object} The result of a previous call to `eventLoopUtilization()` +* `utilization2` {Object} The result of a previous call to `eventLoopUtilization()` prior to `util1` * Returns {Object} * `idle` {number} @@ -72,23 +72,23 @@ high resolution milliseconds timer. The `utilization` value is the calculated Event Loop Utilization (ELU). If bootstrapping has not yet finished, the properties have the value of 0. -`util1` and `util2` are optional parameters. +`utilization1` and `utilization2` are optional parameters. -If `util1` is passed then the delta between the current call's `active` and -`idle` times are calculated and returned (similar to [`process.hrtime()`][]). -Likewise the adjusted `utilization` value is calculated. +If `utilization1` is passed, then the delta between the current call's `active` +and `idle` times, as well as the corresponding `utilization` value are +calculated and returned (similar to [`process.hrtime()`][]). -If `util1` and `util2` are both passed then the calculation adjustments are -done between the two arguments. This is a convenience option because unlike -[`process.hrtime()`][] additional work is done to calculate the ELU. +If `utilization1` and `utilization2` are both passed, then the delta is +calculated between the two arguments. This is a convenience option because, +unlike [`process.hrtime()`][], calculating the ELU is more complex than a +single subtraction. -ELU is similar to CPU utilization except that it is calculated using high -precision wall-clock time. It represents the percentage of time the event loop -has spent outside the event loop's event provider (e.g. `epoll_wait`). No other -CPU idle time is taken into consideration. The following is an example of how -a mostly idle process will have a high ELU. +ELU is similar to CPU utilization, except that it only measures event loop +statistics and not CPU usage. It represents the percentage of time the event +loop has spent outside the event loop's event provider (e.g. `epoll_wait`). +No other CPU idle time is taken into consideration. The following is an example +of how a mostly idle process will have a high ELU. - ```js 'use strict'; const { eventLoopUtilization } = require('perf_hooks').performance; From 0a97f44b506c7eb62ec32b10b35759ff29d52adc Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sat, 12 Sep 2020 18:54:43 -0400 Subject: [PATCH 42/73] tools: update ESLint to 7.9.0 Update ESLint to 7.9.0 PR-URL: https://github.com/nodejs/node/pull/35170 Reviewed-By: Rich Trott Reviewed-By: Trivikram Kamat --- tools/node_modules/eslint/README.md | 2 +- .../lib/cli-engine/config-array-factory.js | 16 +++++++++++----- tools/node_modules/eslint/lib/rules/id-length.js | 9 ++------- .../eslint/lib/rules/prefer-destructuring.js | 5 +++++ .../eslint/lib/rules/utils/ast-utils.js | 4 +++- .../eslint/messages/plugin-invalid.txt | 8 ++++++++ .../eslint/node_modules/acorn-jsx/index.js | 2 +- .../eslint/node_modules/acorn-jsx/package.json | 6 +++--- .../node_modules/eslint-scope/lib/scope.js | 2 +- .../node_modules/eslint-scope/package.json | 4 ++-- tools/node_modules/eslint/package.json | 2 +- 11 files changed, 38 insertions(+), 22 deletions(-) create mode 100644 tools/node_modules/eslint/messages/plugin-invalid.txt diff --git a/tools/node_modules/eslint/README.md b/tools/node_modules/eslint/README.md index a3182dbb0136cb..7f0a8cdbacfe53 100644 --- a/tools/node_modules/eslint/README.md +++ b/tools/node_modules/eslint/README.md @@ -251,7 +251,7 @@ The following companies, organizations, and individuals support ESLint's ongoing

Gold Sponsors

Salesforce Airbnb Microsoft FOSS Fund Sponsorships

Silver Sponsors

Liftoff AMP Project

Bronze Sponsors

-

Veikkaajat.com Nettikasinot.media My True Media Norgekasino Japanesecasino CasinoTop.com Casino Topp Writers Per Hour Anagram Solver Kasinot.fi Pelisivut Nettikasinot.org BonusFinder Deutschland Bugsnag Stability Monitoring Mixpanel VPS Server Icons8: free icons, photos, illustrations, and music Discord ThemeIsle Marfeel

+

Buy.Fineproxy.Org Veikkaajat.com Nettikasinot.media My True Media Norgekasino Japanesecasino CasinoTop.com Casino Topp Anagram Solver Kasinot.fi Pelisivut Nettikasinot.org BonusFinder Deutschland Bugsnag Stability Monitoring Mixpanel VPS Server Icons8: free icons, photos, illustrations, and music Discord ThemeIsle Marfeel Fire Stick Tricks

## Technology Sponsors diff --git a/tools/node_modules/eslint/lib/cli-engine/config-array-factory.js b/tools/node_modules/eslint/lib/cli-engine/config-array-factory.js index e81494ed86ab5c..2c7a79b491ecb3 100644 --- a/tools/node_modules/eslint/lib/cli-engine/config-array-factory.js +++ b/tools/node_modules/eslint/lib/cli-engine/config-array-factory.js @@ -286,14 +286,15 @@ function loadESLintIgnoreFile(filePath) { * Creates an error to notify about a missing config to extend from. * @param {string} configName The name of the missing config. * @param {string} importerName The name of the config that imported the missing config + * @param {string} messageTemplate The text template to source error strings from. * @returns {Error} The error object to throw * @private */ -function configMissingError(configName, importerName) { +function configInvalidError(configName, importerName, messageTemplate) { return Object.assign( new Error(`Failed to load config "${configName}" to extend from.`), { - messageTemplate: "extend-config-missing", + messageTemplate, messageData: { configName, importerName } } ); @@ -802,7 +803,7 @@ class ConfigArrayFactory { }); } - throw configMissingError(extendName, ctx.name); + throw configInvalidError(extendName, ctx.name, "extend-config-missing"); } /** @@ -814,6 +815,11 @@ class ConfigArrayFactory { */ _loadExtendedPluginConfig(extendName, ctx) { const slashIndex = extendName.lastIndexOf("/"); + + if (slashIndex === -1) { + throw configInvalidError(extendName, ctx.filePath, "plugin-invalid"); + } + const pluginName = extendName.slice("plugin:".length, slashIndex); const configName = extendName.slice(slashIndex + 1); @@ -834,7 +840,7 @@ class ConfigArrayFactory { }); } - throw plugin.error || configMissingError(extendName, ctx.filePath); + throw plugin.error || configInvalidError(extendName, ctx.filePath, "extend-config-missing"); } /** @@ -867,7 +873,7 @@ class ConfigArrayFactory { } catch (error) { /* istanbul ignore else */ if (error && error.code === "MODULE_NOT_FOUND") { - throw configMissingError(extendName, ctx.filePath); + throw configInvalidError(extendName, ctx.filePath, "extend-config-missing"); } throw error; } diff --git a/tools/node_modules/eslint/lib/rules/id-length.js b/tools/node_modules/eslint/lib/rules/id-length.js index b97f32b97876cd..4df081ff9fe4f8 100644 --- a/tools/node_modules/eslint/lib/rules/id-length.js +++ b/tools/node_modules/eslint/lib/rules/id-length.js @@ -64,12 +64,7 @@ module.exports = { const minLength = typeof options.min !== "undefined" ? options.min : 2; const maxLength = typeof options.max !== "undefined" ? options.max : Infinity; const properties = options.properties !== "never"; - const exceptions = (options.exceptions ? options.exceptions : []) - .reduce((obj, item) => { - obj[item] = true; - - return obj; - }, {}); + const exceptions = new Set(options.exceptions); const exceptionPatterns = (options.exceptionPatterns || []).map(pattern => new RegExp(pattern, "u")); const reportedNode = new Set(); @@ -130,7 +125,7 @@ module.exports = { const isShort = name.length < minLength; const isLong = name.length > maxLength; - if (!(isShort || isLong) || exceptions[name] || matchesExceptionPattern(name)) { + if (!(isShort || isLong) || exceptions.has(name) || matchesExceptionPattern(name)) { return; // Nothing to report } diff --git a/tools/node_modules/eslint/lib/rules/prefer-destructuring.js b/tools/node_modules/eslint/lib/rules/prefer-destructuring.js index 1a51956dde53ff..d3314dc7e0de77 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-destructuring.js +++ b/tools/node_modules/eslint/lib/rules/prefer-destructuring.js @@ -178,6 +178,11 @@ module.exports = { const rightNode = node.init; const sourceCode = context.getSourceCode(); + // Don't fix if that would remove any comments. Only comments inside `rightNode.object` can be preserved. + if (sourceCode.getCommentsInside(node).length > sourceCode.getCommentsInside(rightNode.object).length) { + return null; + } + return fixer.replaceText( node, `{${rightNode.property.name}} = ${sourceCode.getText(rightNode.object)}` diff --git a/tools/node_modules/eslint/lib/rules/utils/ast-utils.js b/tools/node_modules/eslint/lib/rules/utils/ast-utils.js index 6a42ce3686f597..fb8beb25211ee7 100644 --- a/tools/node_modules/eslint/lib/rules/utils/ast-utils.js +++ b/tools/node_modules/eslint/lib/rules/utils/ast-utils.js @@ -37,7 +37,7 @@ const LINEBREAKS = new Set(["\r\n", "\r", "\n", "\u2028", "\u2029"]); // A set of node types that can contain a list of statements const STATEMENT_LIST_PARENTS = new Set(["Program", "BlockStatement", "SwitchCase"]); -const DECIMAL_INTEGER_PATTERN = /^(0|[1-9](?:_?\d)*)$/u; +const DECIMAL_INTEGER_PATTERN = /^(?:0|0[0-7]*[89]\d*|[1-9](?:_?\d)*)$/u; const OCTAL_ESCAPE_PATTERN = /^(?:[^\\]|\\[^0-7]|\\0(?![0-9]))*\\(?:[1-7]|0[0-9])/u; const LOGICAL_ASSIGNMENT_OPERATORS = new Set(["&&=", "||=", "??="]); @@ -1244,6 +1244,8 @@ module.exports = { * 50 // true * 5_000 // true * 1_234_56 // true + * 08 // true + * 0192 // true * 5. // false * .5 // false * 5.0 // false diff --git a/tools/node_modules/eslint/messages/plugin-invalid.txt b/tools/node_modules/eslint/messages/plugin-invalid.txt new file mode 100644 index 00000000000000..3ee251821bef27 --- /dev/null +++ b/tools/node_modules/eslint/messages/plugin-invalid.txt @@ -0,0 +1,8 @@ +"<%- configName %>" is invalid syntax for a config specifier. + +* If your intention is to extend from a configuration exported from the plugin, add the configuration name after a slash: e.g. "<%- configName %>/myConfig". +* If this is the name of a shareable config instead of a plugin, remove the "plugin:" prefix: i.e. "<%- configName.slice("plugin:".length) %>". + +"<%- configName %>" was referenced from the config file in "<%- importerName %>". + +If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. diff --git a/tools/node_modules/eslint/node_modules/acorn-jsx/index.js b/tools/node_modules/eslint/node_modules/acorn-jsx/index.js index 0ff263c5adae03..004e0809024006 100644 --- a/tools/node_modules/eslint/node_modules/acorn-jsx/index.js +++ b/tools/node_modules/eslint/node_modules/acorn-jsx/index.js @@ -27,7 +27,7 @@ function getJsxTokens(acorn) { const tokTypes = { jsxName: new TokenType('jsxName'), jsxText: new TokenType('jsxText', {beforeExpr: true}), - jsxTagStart: new TokenType('jsxTagStart'), + jsxTagStart: new TokenType('jsxTagStart', {startsExpr: true}), jsxTagEnd: new TokenType('jsxTagEnd') }; diff --git a/tools/node_modules/eslint/node_modules/acorn-jsx/package.json b/tools/node_modules/eslint/node_modules/acorn-jsx/package.json index df867c6ae5c0a3..e26bc863624eb8 100644 --- a/tools/node_modules/eslint/node_modules/acorn-jsx/package.json +++ b/tools/node_modules/eslint/node_modules/acorn-jsx/package.json @@ -6,7 +6,7 @@ "deprecated": false, "description": "Modern, fast React.js JSX parser", "devDependencies": { - "acorn": "^7.0.0" + "acorn": "^8.0.1" }, "homepage": "https://github.com/acornjs/acorn-jsx", "license": "MIT", @@ -19,7 +19,7 @@ ], "name": "acorn-jsx", "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0" + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "repository": { "type": "git", @@ -28,5 +28,5 @@ "scripts": { "test": "node test/run.js" }, - "version": "5.2.0" + "version": "5.3.1" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/eslint-scope/lib/scope.js b/tools/node_modules/eslint/node_modules/eslint-scope/lib/scope.js index 5c4c967780a3e5..bdb5f637f684e5 100644 --- a/tools/node_modules/eslint/node_modules/eslint-scope/lib/scope.js +++ b/tools/node_modules/eslint/node_modules/eslint-scope/lib/scope.js @@ -37,7 +37,7 @@ const assert = require("assert"); * Test if scope is struct * @param {Scope} scope - scope * @param {Block} block - block - * @param {boolean} isMethodDefinition - is method definiton + * @param {boolean} isMethodDefinition - is method definition * @param {boolean} useDirective - use directive * @returns {boolean} is strict scope */ diff --git a/tools/node_modules/eslint/node_modules/eslint-scope/package.json b/tools/node_modules/eslint/node_modules/eslint-scope/package.json index b39dbae1cc391c..bc425ebbd0bea4 100644 --- a/tools/node_modules/eslint/node_modules/eslint-scope/package.json +++ b/tools/node_modules/eslint/node_modules/eslint-scope/package.json @@ -4,7 +4,7 @@ }, "bundleDependencies": false, "dependencies": { - "esrecurse": "^4.1.0", + "esrecurse": "^4.3.0", "estraverse": "^4.1.1" }, "deprecated": false, @@ -49,5 +49,5 @@ "publish-release": "eslint-publish-release", "test": "node Makefile.js test" }, - "version": "5.1.0" + "version": "5.1.1" } \ No newline at end of file diff --git a/tools/node_modules/eslint/package.json b/tools/node_modules/eslint/package.json index 3d2f9ab4c83ea4..8801f73606f62c 100644 --- a/tools/node_modules/eslint/package.json +++ b/tools/node_modules/eslint/package.json @@ -154,5 +154,5 @@ "test:cli": "mocha", "webpack": "node Makefile.js webpack" }, - "version": "7.8.1" + "version": "7.9.0" } \ No newline at end of file From 066148d22954d9c58e0051d2c53292785caa693e Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 13 Sep 2020 08:59:55 -0700 Subject: [PATCH 43/73] doc: remove problematic auto-linking of curl man pages The only instance of curl man page linking is in repl.md and it is explicit. The magic autolinking in html.js creates a superfluous empty link. Remove it. Before, two adjacent links generated, with the first one having no text: ```html curl(1) ``` After, just one link: ```html curl(1) ``` PR-URL: https://github.com/nodejs/node/pull/35174 Reviewed-By: Anna Henningsen Reviewed-By: Ben Coe Reviewed-By: Luigi Pinca --- doc/api/repl.md | 4 ++-- tools/doc/html.js | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/doc/api/repl.md b/doc/api/repl.md index 43e8d4f578c391..f8ab8fa7e7d104 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -741,7 +741,7 @@ For an example of running a "full-featured" (`terminal`) REPL over a `net.Server` and `net.Socket` instance, see: . -For an example of running a REPL instance over [curl(1)][], see: +For an example of running a REPL instance over [`curl(1)`][], see: . [ZSH]: https://en.wikipedia.org/wiki/Z_shell @@ -757,5 +757,5 @@ For an example of running a REPL instance over [curl(1)][], see: [`util.inspect()`]: util.html#util_util_inspect_object_options [`reverse-i-search`]: #repl_reverse_i_search [TTY keybindings]: readline.html#readline_tty_keybindings -[curl(1)]: https://curl.haxx.se/docs/manpage.html +[`curl(1)`]: https://curl.haxx.se/docs/manpage.html [stream]: stream.html diff --git a/tools/doc/html.js b/tools/doc/html.js index ae8c1b10ddad7a..cbed8ba6b2d8ef 100644 --- a/tools/doc/html.js +++ b/tools/doc/html.js @@ -126,7 +126,6 @@ function preprocessText({ nodeVersion }) { // Syscalls which appear in the docs, but which only exist in BSD / macOS. const BSD_ONLY_SYSCALLS = new Set(['lchmod']); -const HAXX_ONLY_SYSCALLS = new Set(['curl']); const MAN_PAGE = /(^|\s)([a-z.]+)\((\d)([a-z]?)\)/gm; // Handle references to man pages, eg "open(2)" or "lchmod(2)". @@ -143,9 +142,6 @@ function linkManPages(text) { return `${beginning}${displayAs}`; } - if (HAXX_ONLY_SYSCALLS.has(name)) { - return `${beginning}${displayAs}`; - } return `${beginning}${displayAs}`; From 49da459ce624fe44fbe267fb02acdfce03d5d4c9 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 13 Sep 2020 09:54:56 -0700 Subject: [PATCH 44/73] test: improve pummel/test-timers.js * use Date.now() instead of new Date() because only the timestamp is ever used, so we don't need the full Date object * use separate start times recorded for the two different test cases * improve assertion messages PR-URL: https://github.com/nodejs/node/pull/35175 Reviewed-By: Daijiro Wachi Reviewed-By: Anna Henningsen Reviewed-By: Shingo Inoue --- test/pummel/test-timers.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/pummel/test-timers.js b/test/pummel/test-timers.js index cd6417abe4079f..d5d992f7b9a552 100644 --- a/test/pummel/test-timers.js +++ b/test/pummel/test-timers.js @@ -26,10 +26,11 @@ const assert = require('assert'); const WINDOW = 200; // Why does this need to be so big? -const starttime = new Date(); { + const starttime = Date.now(); + setTimeout(common.mustCall(function() { - const endtime = new Date(); + const endtime = Date.now(); const diff = endtime - starttime; assert.ok(diff > 0); @@ -46,11 +47,13 @@ const starttime = new Date(); } { + const starttime = Date.now(); + let interval_count = 0; setInterval(common.mustCall(function() { interval_count += 1; - const endtime = new Date(); + const endtime = Date.now(); const diff = endtime - starttime; assert.ok(diff > 0); @@ -58,9 +61,9 @@ const starttime = new Date(); const t = interval_count * 1000; - assert.strictEqual(t - WINDOW < diff && diff < t + WINDOW, true); + assert.ok(t - WINDOW < diff && diff < t + WINDOW, `t: ${t}`); - assert.strictEqual(interval_count <= 3, true); + assert.ok(interval_count <= 3, `interval_count: ${interval_count}`); if (interval_count === 3) clearInterval(this); }, 3), 1000); From 76e24f9aa9ba6e95b37b0e339ddf8dba86a2b7b7 Mon Sep 17 00:00:00 2001 From: Antoine du HAMEL Date: Thu, 27 Aug 2020 23:36:50 +0200 Subject: [PATCH 45/73] module: use isURLInstance instead of instanceof PR-URL: https://github.com/nodejs/node/pull/34951 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Derek Lewis --- lib/internal/modules/cjs/loader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index 0f8647a5f22992..99e0bdc5084ee8 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -58,7 +58,7 @@ const { maybeCacheSourceMap, rekeySourceMap } = require('internal/source_map/source_map_cache'); -const { pathToFileURL, fileURLToPath, URL } = require('internal/url'); +const { pathToFileURL, fileURLToPath, isURLInstance } = require('internal/url'); const { deprecate } = require('internal/util'); const vm = require('vm'); const assert = require('internal/assert'); @@ -1156,7 +1156,7 @@ const createRequireError = 'must be a file URL object, file URL string, or ' + function createRequire(filename) { let filepath; - if (filename instanceof URL || + if (isURLInstance(filename) || (typeof filename === 'string' && !path.isAbsolute(filename))) { try { filepath = fileURLToPath(filename); From beb75bd0317c48de1d88a8e54625a80e59b3959f Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 30 Aug 2020 21:20:48 -0700 Subject: [PATCH 46/73] fs: loosen validation to allow objects with an own toString function PR-URL: https://github.com/nodejs/node/pull/34993 Reviewed-By: Joyee Cheung Reviewed-By: Bradley Farias Reviewed-By: Matteo Collina Reviewed-By: Benjamin Gruenbaum Reviewed-By: Derek Lewis --- doc/api/fs.md | 80 ++++++++++++++++++------ lib/fs.js | 7 ++- lib/internal/fs/utils.js | 24 +++++-- test/parallel/test-fs-write-file-sync.js | 14 +++++ test/parallel/test-fs-write.js | 16 +++++ 5 files changed, 113 insertions(+), 28 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 0f67e31a52fefa..7932426b2983fc 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -4143,6 +4143,10 @@ This happens when: * `fd` {integer} -* `buffer` {Buffer|TypedArray|DataView} +* `buffer` {Buffer|TypedArray|DataView|string|Object} * `offset` {integer} * `length` {integer} * `position` {integer} @@ -4177,7 +4181,8 @@ changes: * `bytesWritten` {integer} * `buffer` {Buffer|TypedArray|DataView} -Write `buffer` to the file specified by `fd`. +Write `buffer` to the file specified by `fd`. If `buffer` is a normal object, it +must have an own `toString` function property. `offset` determines the part of the buffer to be written, and `length` is an integer specifying the number of bytes to write. @@ -4204,6 +4209,10 @@ the end of the file. * `fd` {integer} -* `string` {string} +* `string` {string|Object} * `position` {integer} * `encoding` {string} **Default:** `'utf8'` * `callback` {Function} @@ -4230,8 +4239,8 @@ changes: * `written` {integer} * `string` {string} -Write `string` to the file specified by `fd`. If `string` is not a string, then -an exception will be thrown. +Write `string` to the file specified by `fd`. If `string` is not a string, or an +object with an own `toString` function property, then an exception is thrown. `position` refers to the offset from the beginning of the file where this data should be written. If `typeof position !== 'number'` the data will be written at @@ -4263,6 +4272,10 @@ details. * `file` {string|Buffer|URL|integer} filename or file descriptor -* `data` {string|Buffer|TypedArray|DataView} +* `data` {string|Buffer|TypedArray|DataView|Object} * `options` {Object|string} * `encoding` {string|null} **Default:** `'utf8'` * `mode` {integer} **Default:** `0o666` @@ -4304,6 +4317,7 @@ When `file` is a file descriptor, the behavior is similar to calling a file descriptor. The `encoding` option is ignored if `data` is a buffer. +If `data` is a normal object, it must have an own `toString` function property. ```js const data = new Uint8Array(Buffer.from('Hello Node.js')); @@ -4353,6 +4367,10 @@ to contain only `', World'`. * `file` {string|Buffer|URL|integer} filename or file descriptor -* `data` {string|Buffer|TypedArray|DataView} +* `data` {string|Buffer|TypedArray|DataView|Object} * `options` {Object|string} * `encoding` {string|null} **Default:** `'utf8'` * `mode` {integer} **Default:** `0o666` @@ -4385,6 +4403,10 @@ this API: [`fs.writeFile()`][]. * `fd` {integer} -* `buffer` {Buffer|TypedArray|DataView} +* `buffer` {Buffer|TypedArray|DataView|string|Object} * `offset` {integer} * `length` {integer} * `position` {integer} @@ -4415,6 +4437,10 @@ this API: [`fs.write(fd, buffer...)`][]. * `fd` {integer} -* `string` {string} +* `string` {string|Object} * `position` {integer} * `encoding` {string} * Returns: {number} The number of bytes written. @@ -4788,13 +4814,17 @@ This function does not work on AIX versions before 7.1, it will resolve the -* `buffer` {Buffer|Uint8Array} +* `buffer` {Buffer|Uint8Array|string|Object} * `offset` {integer} * `length` {integer} * `position` {integer} @@ -4825,19 +4855,23 @@ the end of the file. -* `string` {string} +* `string` {string|Object} * `position` {integer} * `encoding` {string} **Default:** `'utf8'` * Returns: {Promise} -Write `string` to the file. If `string` is not a string, then -an exception will be thrown. +Write `string` to the file. If `string` is not a string, or an +object with an own `toString` function property, then an exception is thrown. The `Promise` is resolved with an object containing a `bytesWritten` property identifying the number of bytes written, and a `buffer` property containing @@ -4861,20 +4895,24 @@ the end of the file. -* `data` {string|Buffer|Uint8Array} +* `data` {string|Buffer|Uint8Array|Object} * `options` {Object|string} * `encoding` {string|null} **Default:** `'utf8'` * Returns: {Promise} Asynchronously writes data to a file, replacing the file if it already exists. -`data` can be a string or a buffer. The `Promise` will be resolved with no -arguments upon success. +`data` can be a string, a buffer, or an object with an own `toString` function +property. The `Promise` is resolved with no arguments upon success. The `encoding` option is ignored if `data` is a buffer. @@ -5492,6 +5530,10 @@ The `atime` and `mtime` arguments follow these rules: * `file` {string|Buffer|URL|FileHandle} filename or `FileHandle` -* `data` {string|Buffer|Uint8Array} +* `data` {string|Buffer|Uint8Array|Object} * `options` {Object|string} * `encoding` {string|null} **Default:** `'utf8'` * `mode` {integer} **Default:** `0o666` @@ -5507,8 +5549,8 @@ changes: * Returns: {Promise} Asynchronously writes data to a file, replacing the file if it already exists. -`data` can be a string or a buffer. The `Promise` will be resolved with no -arguments upon success. +`data` can be a string, a buffer, or an object with an own `toString` function +property. The `Promise` is resolved with no arguments upon success. The `encoding` option is ignored if `data` is a buffer. diff --git a/lib/fs.js b/lib/fs.js index 229167fc51eac6..67a050b4e8c480 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -37,6 +37,7 @@ const { ObjectDefineProperties, ObjectDefineProperty, Promise, + String, } = primordials; const { fs: constants } = internalBinding('constants'); @@ -663,7 +664,7 @@ function write(fd, buffer, offset, length, position, callback) { const req = new FSReqCallback(); req.oncomplete = wrapper; - return binding.writeString(fd, buffer, offset, length, req); + return binding.writeString(fd, String(buffer), offset, length, req); } ObjectDefineProperty(write, internalUtil.customPromisifyArgs, @@ -1383,7 +1384,7 @@ function writeFile(path, data, options, callback) { if (!isArrayBufferView(data)) { validateStringAfterArrayBufferView(data, 'data'); - data = Buffer.from(data, options.encoding || 'utf8'); + data = Buffer.from(String(data), options.encoding || 'utf8'); } if (isFd(path)) { @@ -1407,7 +1408,7 @@ function writeFileSync(path, data, options) { if (!isArrayBufferView(data)) { validateStringAfterArrayBufferView(data, 'data'); - data = Buffer.from(data, options.encoding || 'utf8'); + data = Buffer.from(String(data), options.encoding || 'utf8'); } const flag = options.flag || 'w'; diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index 712bd87d85f6e6..ed89c616f26802 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -5,6 +5,7 @@ const { BigInt, DateNow, Error, + ObjectPrototypeHasOwnProperty, Number, NumberIsFinite, MathMin, @@ -697,13 +698,24 @@ const getValidMode = hideStackFrames((mode, type) => { }); const validateStringAfterArrayBufferView = hideStackFrames((buffer, name) => { - if (typeof buffer !== 'string') { - throw new ERR_INVALID_ARG_TYPE( - name, - ['string', 'Buffer', 'TypedArray', 'DataView'], - buffer - ); + if (typeof buffer === 'string') { + return; + } + + if ( + typeof buffer === 'object' && + buffer !== null && + typeof buffer.toString === 'function' && + ObjectPrototypeHasOwnProperty(buffer, 'toString') + ) { + return; } + + throw new ERR_INVALID_ARG_TYPE( + name, + ['string', 'Buffer', 'TypedArray', 'DataView'], + buffer + ); }); module.exports = { diff --git a/test/parallel/test-fs-write-file-sync.js b/test/parallel/test-fs-write-file-sync.js index 013322ed15ba46..2ef7d14365b781 100644 --- a/test/parallel/test-fs-write-file-sync.js +++ b/test/parallel/test-fs-write-file-sync.js @@ -101,3 +101,17 @@ tmpdir.refresh(); const content = fs.readFileSync(file, { encoding: 'utf8' }); assert.strictEqual(content, 'hello world!'); } + +// Test writeFileSync with an object with an own toString function +{ + const file = path.join(tmpdir.path, 'testWriteFileSyncStringify.txt'); + const data = { + toString() { + return 'hello world!'; + } + }; + + fs.writeFileSync(file, data, { encoding: 'utf8', flag: 'a' }); + const content = fs.readFileSync(file, { encoding: 'utf8' }); + assert.strictEqual(content, String(data)); +} diff --git a/test/parallel/test-fs-write.js b/test/parallel/test-fs-write.js index bdbbad9cb834d4..a6724eac300d16 100644 --- a/test/parallel/test-fs-write.js +++ b/test/parallel/test-fs-write.js @@ -32,6 +32,7 @@ tmpdir.refresh(); const fn = path.join(tmpdir.path, 'write.txt'); const fn2 = path.join(tmpdir.path, 'write2.txt'); const fn3 = path.join(tmpdir.path, 'write3.txt'); +const fn4 = path.join(tmpdir.path, 'write4.txt'); const expected = 'ümlaut.'; const constants = fs.constants; @@ -134,6 +135,21 @@ fs.open(fn3, 'w', 0o644, common.mustCall((err, fd) => { fs.write(fd, expected, done); })); +fs.open(fn4, 'w', 0o644, common.mustCall((err, fd) => { + assert.ifError(err); + + const done = common.mustCall((err, written) => { + assert.ifError(err); + assert.strictEqual(written, Buffer.byteLength(expected)); + fs.closeSync(fd); + }); + + const data = { + toString() { return expected; } + }; + fs.write(fd, data, done); +})); + [false, 'test', {}, [], null, undefined].forEach((i) => { assert.throws( () => fs.write(i, common.mustNotCall()), From 910deff2dea550a84f98b10748daa3e4cfcfa567 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 13 Sep 2020 21:55:50 -0700 Subject: [PATCH 47/73] doc: fix broken link in crypto.md URL that lacks a scheme gets treated as a relative URL. Add missing `https://`. PR-URL: https://github.com/nodejs/node/pull/35181 Reviewed-By: Derek Lewis Reviewed-By: Daijiro Wachi Reviewed-By: Harshitha K P Reviewed-By: Luigi Pinca --- doc/api/crypto.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index b56676e41ef40e..d4e4e10596e215 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -3614,7 +3614,7 @@ See the [list of SSL OP Flags][] for details. [RFC 5208]: https://www.rfc-editor.org/rfc/rfc5208.txt [encoding]: buffer.html#buffer_buffers_and_character_encodings [initialization vector]: https://en.wikipedia.org/wiki/Initialization_vector -[list of SSL OP Flags]: wiki.openssl.org/index.php/List_of_SSL_OP_Flags#Table_of_Options +[list of SSL OP Flags]: https://wiki.openssl.org/index.php/List_of_SSL_OP_Flags#Table_of_Options [safe integers]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger [scrypt]: https://en.wikipedia.org/wiki/Scrypt [stream]: stream.html From c1e16d15dd07edf9c69c8213336c0d7d6105faad Mon Sep 17 00:00:00 2001 From: Antoine du HAMEL Date: Sun, 6 Sep 2020 23:37:38 +0200 Subject: [PATCH 48/73] doc: fix deprecation documentation inconsistencies PR-URL: https://github.com/nodejs/node/pull/35082 Reviewed-By: Rich Trott --- doc/api/domain.md | 1 + doc/api/events.md | 2 +- doc/api/fs.md | 4 ++++ doc/api/punycode.md | 5 +---- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/api/domain.md b/doc/api/domain.md index 109e41f749f1b4..c878ce892ccc64 100644 --- a/doc/api/domain.md +++ b/doc/api/domain.md @@ -1,5 +1,6 @@ # Domain > Stability: 0 - Deprecated: Use [`emitter.listenerCount()`][] instead. diff --git a/doc/api/fs.md b/doc/api/fs.md index 7932426b2983fc..41b635b78afcf7 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -2399,6 +2399,8 @@ changes: pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013. + - version: v0.4.7 + description: Documentation-only deprecation. --> * `path` {string|Buffer|URL} @@ -2416,6 +2418,8 @@ changes: - version: v10.6.0 pr-url: https://github.com/nodejs/node/pull/21498 description: This API is no longer deprecated. + - version: v0.4.7 + description: Documentation-only deprecation. --> * `path` {string|Buffer|URL} diff --git a/doc/api/punycode.md b/doc/api/punycode.md index bcdfb9a167fd04..d19d79f8195a78 100644 --- a/doc/api/punycode.md +++ b/doc/api/punycode.md @@ -1,9 +1,6 @@ # Punycode From e5fffe2f8fb706869988d19a468cf1dcf24f9d31 Mon Sep 17 00:00:00 2001 From: Tom Atkinson Date: Wed, 16 Sep 2020 16:38:46 +0200 Subject: [PATCH 49/73] doc: fix missing word in dgram.md The word "cannot" is missing from this sentence PR-URL: https://github.com/nodejs/node/pull/35231 Reviewed-By: Richard Lau Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Daijiro Wachi --- doc/api/dgram.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/dgram.md b/doc/api/dgram.md index 57afbe6135ce97..53f3e330a6aa82 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -524,7 +524,7 @@ The maximum size of an `IPv4/v6` datagram depends on the `MTU` (_Maximum Transmission Unit_) and on the `Payload Length` field size. * The `Payload Length` field is `16 bits` wide, which means that a normal - payload exceed 64K octets _including_ the internet header and data + payload cannot exceed 64K octets _including_ the internet header and data (65,507 bytes = 65,535 − 8 bytes UDP header − 20 bytes IP header); this is generally true for loopback interfaces, but such long datagram messages are impractical for most hosts and networks. From 70ec369b7619ee4f4625ff6859be5ad70d80656e Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 14 Sep 2020 12:55:32 -0700 Subject: [PATCH 50/73] doc: replace "you should do X" with "do X" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/35194 Reviewed-By: Michaël Zasso Reviewed-By: Anna Henningsen --- doc/api/async_hooks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 921147f5cc09b0..50baa8d4dde79e 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -1157,14 +1157,14 @@ functions called by `foo`. Outside of `run`, calling `getStore` will return In most cases your application or library code should have no issues with `AsyncLocalStorage`. But in rare cases you may face situations when the -current store is lost in one of asynchronous operations. Then you should +current store is lost in one of asynchronous operations. In those cases, consider the following options. If your code is callback-based, it is enough to promisify it with [`util.promisify()`][], so it starts working with native promises. If you need to keep using callback-based API, or your code assumes -a custom thenable implementation, you should use [`AsyncResource`][] class +a custom thenable implementation, use the [`AsyncResource`][] class to associate the asynchronous operation with the correct execution context. [`AsyncResource`]: #async_hooks_class_asyncresource From c1c93a6cdee1e2998ded0d0146b2fd4cb620d958 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 14 Sep 2020 17:28:27 -0700 Subject: [PATCH 51/73] doc: use command-line/command line consistently MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docs switch between "command line" and "command-line" with no apparent uniformity. Microsoft Style Guide prescribes "command line" as a noun and "command-line" as a modifier, which makes a lot of sense to me. Updating docs as appropriate. PR-URL: https://github.com/nodejs/node/pull/35198 Reviewed-By: Anna Henningsen Reviewed-By: Daijiro Wachi Reviewed-By: Tobias Nießen Reviewed-By: Luigi Pinca Reviewed-By: Trivikram Kamat --- doc/api/buffer.md | 4 ++-- doc/api/child_process.md | 6 +++--- doc/api/cli.md | 30 +++++++++++++++--------------- doc/api/events.md | 2 +- doc/api/index.md | 2 +- doc/api/process.md | 14 +++++++------- doc/api/repl.md | 4 ++-- doc/api/synopsis.md | 4 ++-- doc/api/tls.md | 8 ++++---- doc/api/util.md | 8 ++++---- doc/api/v8.md | 4 ++-- doc/api/wasi.md | 4 ++-- doc/node.1 | 10 +++++----- 13 files changed, 50 insertions(+), 50 deletions(-) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 4902106a595de9..56449d1a6ec193 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -3229,12 +3229,12 @@ if `size` is less than or equal to half [`Buffer.poolSize`][]. Instances returned by [`Buffer.allocUnsafeSlow()`][] *never* use the shared internal memory pool. -### The `--zero-fill-buffers` command line option +### The `--zero-fill-buffers` command-line option -Node.js can be started using the `--zero-fill-buffers` command line option to +Node.js can be started using the `--zero-fill-buffers` command-line option to cause all newly-allocated `Buffer` instances to be zero-filled upon creation by default. Without the option, buffers created with [`Buffer.allocUnsafe()`][], [`Buffer.allocUnsafeSlow()`][], and `new SlowBuffer(size)` are not zero-filled. diff --git a/doc/api/child_process.md b/doc/api/child_process.md index d88adf49885b11..7ef5c82387346b 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -449,7 +449,7 @@ changes: * Returns: {ChildProcess} The `child_process.spawn()` method spawns a new process using the given -`command`, with command line arguments in `args`. If omitted, `args` defaults +`command`, with command-line arguments in `args`. If omitted, `args` defaults to an empty array. **If the `shell` option is enabled, do not pass unsanitized user input to this @@ -1398,7 +1398,7 @@ the child process if any, else `null`. * {Array} -The `subprocess.spawnargs` property represents the full list of command line +The `subprocess.spawnargs` property represents the full list of command-line arguments the child process was launched with. ### `subprocess.spawnfile` @@ -1547,7 +1547,7 @@ to `stdout` although there are only 4 characters. ## Shell requirements The shell should understand the `-c` switch. If the shell is `'cmd.exe'`, it -should understand the `/d /s /c` switches and command line parsing should be +should understand the `/d /s /c` switches and command-line parsing should be compatible. ## Default Windows shell diff --git a/doc/api/cli.md b/doc/api/cli.md index 9f9a07056f0600..b0ff3fe30c2f13 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1,4 +1,4 @@ -# Command line options +# Command-line options @@ -43,7 +43,7 @@ environment variable. added: v8.0.0 --> -Alias for stdin. Analogous to the use of `-` in other command line utilities, +Alias for stdin. Analogous to the use of `-` in other command-line utilities, meaning that the script is read from stdin, and the rest of the options are passed to that script. @@ -128,7 +128,7 @@ Specify the directory where the CPU profiles generated by `--cpu-prof` will be placed. The default value is controlled by the -[--diagnostic-dir](#cli_diagnostic_dir_directory) command line option. +[--diagnostic-dir](#cli_diagnostic_dir_directory) command-line option. ### `--cpu-prof-interval` -Print V8 command line options. +Print V8 command-line options. ### `--v8-pool-size=num` -Print node command line options. +Print node command-line options. The output of this option is less detailed than this document. ### `-i`, `--interactive` @@ -1185,8 +1185,8 @@ When set to `1`, process warnings are silenced. added: v8.0.0 --> -A space-separated list of command line options. `options...` are interpreted -before command line options, so command line options will override or +A space-separated list of command-line options. `options...` are interpreted +before command-line options, so command-line options will override or compound after anything in `options...`. Node.js will exit with an error if an option that is not allowed in the environment is used, such as `-p` or a script file. @@ -1197,7 +1197,7 @@ If an option value contains a space, it can be escaped using double quotes: NODE_OPTIONS='--require "./my path/file.js"' ``` -A singleton flag passed as a command line option will override the same flag +A singleton flag passed as a command-line option will override the same flag passed into `NODE_OPTIONS`: ```bash @@ -1206,7 +1206,7 @@ NODE_OPTIONS='--inspect=localhost:4444' node --inspect=localhost:5555 ``` A flag that can be passed multiple times will be treated as if its -`NODE_OPTIONS` instances were passed first, and then its command line +`NODE_OPTIONS` instances were passed first, and then its command-line instances afterwards: ```bash @@ -1331,7 +1331,7 @@ When set to `1`, emit pending deprecation warnings. Pending deprecations are generally identical to a runtime deprecation with the notable exception that they are turned *off* by default and will not be emitted -unless either the `--pending-deprecation` command line flag, or the +unless either the `--pending-deprecation` command-line flag, or the `NODE_PENDING_DEPRECATION=1` environment variable, is set. Pending deprecations are used to provide a kind of selective "early warning" mechanism that developers may leverage to detect deprecated API usage. @@ -1479,7 +1479,7 @@ Load an OpenSSL configuration file on startup. Among other uses, this can be used to enable FIPS-compliant crypto if Node.js is built with `./configure --openssl-fips`. -If the [`--openssl-config`][] command line option is used, the environment +If the [`--openssl-config`][] command-line option is used, the environment variable is ignored. ### `SSL_CERT_DIR=dir` diff --git a/doc/api/events.md b/doc/api/events.md index 37f2468970bd1e..a3b77553bab46e 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -355,7 +355,7 @@ emitter.once('event', () => { }); ``` -The [`--trace-warnings`][] command line flag can be used to display the +The [`--trace-warnings`][] command-line flag can be used to display the stack trace for such warnings. The emitted warning can be inspected with [`process.on('warning')`][] and will diff --git a/doc/api/index.md b/doc/api/index.md index f5ef2b312f72b3..756b79ec0812dc 100644 --- a/doc/api/index.md +++ b/doc/api/index.md @@ -18,7 +18,7 @@ * [C++ embedder API](embedding.html) * [Child processes](child_process.html) * [Cluster](cluster.html) -* [Command line options](cli.html) +* [Command-line options](cli.html) * [Console](console.html) * [Crypto](crypto.html) * [Debugger](debugger.html) diff --git a/doc/api/process.md b/doc/api/process.md index 3c733b70c2bb42..385f0c30feb4eb 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -440,16 +440,16 @@ $ node --no-warnings The `--trace-warnings` command-line option can be used to have the default console output for warnings include the full stack trace of the warning. -Launching Node.js using the `--throw-deprecation` command line flag will +Launching Node.js using the `--throw-deprecation` command-line flag will cause custom deprecation warnings to be thrown as exceptions. -Using the `--trace-deprecation` command line flag will cause the custom +Using the `--trace-deprecation` command-line flag will cause the custom deprecation to be printed to `stderr` along with the stack trace. -Using the `--no-deprecation` command line flag will suppress all reporting +Using the `--no-deprecation` command-line flag will suppress all reporting of the custom deprecation. -The `*-deprecation` command line flags only affect warnings that use the name +The `*-deprecation` command-line flags only affect warnings that use the name `'DeprecationWarning'`. #### Emitting custom warnings @@ -616,11 +616,11 @@ added: v0.1.27 * {string[]} -The `process.argv` property returns an array containing the command line +The `process.argv` property returns an array containing the command-line arguments passed when the Node.js process was launched. The first element will be [`process.execPath`][]. See `process.argv0` if access to the original value of `argv[0]` is needed. The second element will be the path to the JavaScript -file being executed. The remaining elements will be any additional command line +file being executed. The remaining elements will be any additional command-line arguments. For example, assuming the following script for `process-args.js`: @@ -2398,7 +2398,7 @@ the current value of `ps`. When a new value is assigned, different platforms will impose different maximum length restrictions on the title. Usually such restrictions are quite limited. For instance, on Linux and macOS, `process.title` is limited to the size of the -binary name plus the length of the command line arguments because setting the +binary name plus the length of the command-line arguments because setting the `process.title` overwrites the `argv` memory of the process. Node.js v0.8 allowed for longer process title strings by also overwriting the `environ` memory but that was potentially insecure and confusing in some (rather obscure) diff --git a/doc/api/repl.md b/doc/api/repl.md index f8ab8fa7e7d104..e3daa00da8ea35 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -224,7 +224,7 @@ Error: foo #### `await` keyword -With the [`--experimental-repl-await`][] command line option specified, +With the [`--experimental-repl-await`][] command-line option specified, experimental support for the `await` keyword is enabled. ```console @@ -537,7 +537,7 @@ added: v11.10.0 * `repl` {repl.REPLServer} Initializes a history log file for the REPL instance. When executing the -Node.js binary and using the command line REPL, a history file is initialized +Node.js binary and using the command-line REPL, a history file is initialized by default. However, this is not the case when creating a REPL programmatically. Use this method to initialize a history log file when working with REPL instances programmatically. diff --git a/doc/api/synopsis.md b/doc/api/synopsis.md index 8ae933a499a16c..1a8fd3ab4bbc88 100644 --- a/doc/api/synopsis.md +++ b/doc/api/synopsis.md @@ -7,7 +7,7 @@ `node [options] [V8 options] [script.js | -e "script" | - ] [arguments]` -Please see the [Command Line Options][] document for more information. +Please see the [Command-line options][] document for more information. ## Example An example of a [web server][] written with Node.js which responds with @@ -86,6 +86,6 @@ Now, open any preferred web browser and visit `http://127.0.0.1:3000`. If the browser displays the string `Hello, World!`, that indicates the server is working. -[Command Line Options]: cli.html#cli_command_line_options +[Command-line options]: cli.html#cli_command_line_options [this guide]: https://nodejs.org/en/download/package-manager/ [web server]: http.html diff --git a/doc/api/tls.md b/doc/api/tls.md index 7746f25df8dda5..19ec9e1aa38b26 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -308,10 +308,10 @@ HIGH !CAMELLIA ``` -This default can be replaced entirely using the [`--tls-cipher-list`][] command -line switch (directly, or via the [`NODE_OPTIONS`][] environment variable). For -instance, the following makes `ECDHE-RSA-AES128-GCM-SHA256:!RC4` the default TLS -cipher suite: +This default can be replaced entirely using the [`--tls-cipher-list`][] +command-line switch (directly, or via the [`NODE_OPTIONS`][] environment +variable). For instance, the following makes `ECDHE-RSA-AES128-GCM-SHA256:!RC4` +the default TLS cipher suite: ```bash node --tls-cipher-list='ECDHE-RSA-AES128-GCM-SHA256:!RC4' server.js diff --git a/doc/api/util.md b/doc/api/util.md index e39fb08e240a04..bc75caa1b7bcbe 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -217,20 +217,20 @@ fn1(); // Emits a deprecation warning with code DEP0001 fn2(); // Does not emit a deprecation warning because it has the same code ``` -If either the `--no-deprecation` or `--no-warnings` command line flags are +If either the `--no-deprecation` or `--no-warnings` command-line flags are used, or if the `process.noDeprecation` property is set to `true` *prior* to the first deprecation warning, the `util.deprecate()` method does nothing. -If the `--trace-deprecation` or `--trace-warnings` command line flags are set, +If the `--trace-deprecation` or `--trace-warnings` command-line flags are set, or the `process.traceDeprecation` property is set to `true`, a warning and a stack trace are printed to `stderr` the first time the deprecated function is called. -If the `--throw-deprecation` command line flag is set, or the +If the `--throw-deprecation` command-line flag is set, or the `process.throwDeprecation` property is set to `true`, then an exception will be thrown when the deprecated function is called. -The `--throw-deprecation` command line flag and `process.throwDeprecation` +The `--throw-deprecation` command-line flag and `process.throwDeprecation` property take precedence over `--trace-deprecation` and `process.traceDeprecation`. diff --git a/doc/api/v8.md b/doc/api/v8.md index 921c4378199496..a70567475f03d8 100644 --- a/doc/api/v8.md +++ b/doc/api/v8.md @@ -21,7 +21,7 @@ added: v8.0.0 * Returns: {integer} Returns an integer representing a "version tag" derived from the V8 version, -command line flags and detected CPU features. This is useful for determining +command-line flags and detected CPU features. This is useful for determining whether a [`vm.Script`][] `cachedData` buffer is compatible with this instance of V8. @@ -198,7 +198,7 @@ added: v1.0.0 * `flags` {string} The `v8.setFlagsFromString()` method can be used to programmatically set -V8 command line flags. This method should be used with care. Changing settings +V8 command-line flags. This method should be used with care. Changing settings after the VM has started may result in unpredictable behavior, including crashes and data loss; or it may simply do nothing. diff --git a/doc/api/wasi.md b/doc/api/wasi.md index b08c6c5558fcda..85a75bd104f857 100644 --- a/doc/api/wasi.md +++ b/doc/api/wasi.md @@ -83,7 +83,7 @@ added: The `WASI` class provides the WASI system call API and additional convenience methods for working with WASI-based applications. Each `WASI` instance represents a distinct sandbox environment. For security purposes, each `WASI` -instance must have its command line arguments, environment variables, and +instance must have its command-line arguments, environment variables, and sandbox directory structure configured explicitly. ### `new WASI([options])` @@ -95,7 +95,7 @@ added: * `options` {Object} * `args` {Array} An array of strings that the WebAssembly application will - see as command line arguments. The first argument is the virtual path to the + see as command-line arguments. The first argument is the virtual path to the WASI command itself. **Default:** `[]`. * `env` {Object} An object similar to `process.env` that the WebAssembly application will see as its environment. **Default:** `{}`. diff --git a/doc/node.1 b/doc/node.1 index 45c82c2009ec66..f52014dbdcb9dc 100644 --- a/doc/node.1 +++ b/doc/node.1 @@ -95,7 +95,7 @@ The directory where the CPU profiles generated by will be placed. The default value is controlled by the .Fl -diagnostic-dir . -command line option. +command-line option. . .It Fl -cpu-prof-interval The sampling interval in microseconds for the CPU profiles generated by @@ -198,7 +198,7 @@ The directory where the heap profiles generated by will be placed. The default value is controlled by the .Fl -diagnostic-dir . -command line option. +command-line option. . .It Fl -heap-prof-interval The average sampling interval in bytes for the heap profiles generated by @@ -319,7 +319,7 @@ will be generated. The `file` name may be an absolute path. If it is not, the default directory it will be written to is controlled by the .Fl -diagnostic-dir . -command line option. +command-line option. . .It Fl -report-filename Name of the file to which the @@ -554,7 +554,7 @@ process warnings are silenced. .It Ev NODE_OPTIONS Ar options... A space-separated list of command-line .Ar options , -which are interpreted as if they had been specified on the command-line before the actual command (so they can be overridden). +which are interpreted as if they had been specified on the command line before the actual command (so they can be overridden). Node.js will exit with an error if an option that is not allowed in the environment is used, such as .Fl -print or a script file. @@ -580,7 +580,7 @@ Write process warnings to the given instead of printing to stderr. Equivalent to passing .Fl -redirect-warnings Ar file -on command-line. +on the command line. .It Ev NODE_REPL_HISTORY Ar file Path to the .Ar file From dbfd3b261d198ab49b60978f931e69ebe2f8cd97 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 14 Sep 2020 17:40:34 -0700 Subject: [PATCH 52/73] doc: remove "end user" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We use "end user" in ambiguous ways. Sometimes we mean the developer, and sometimes we mean the application user. Use "developer" where developer is meant. Refs: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/u/user-end-user PR-URL: https://github.com/nodejs/node/pull/35200 Reviewed-By: Michaël Zasso Reviewed-By: Daijiro Wachi --- doc/api/deprecations.md | 2 +- doc/api/documentation.md | 4 ++-- doc/api/domain.md | 2 +- doc/api/errors.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 5729a9fd87fc27..261c7fbd91105c 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1726,7 +1726,7 @@ Type: Deprecation revoked Importing assert directly was not recommended as the exposed functions use loose equality checks. The deprecation was revoked because use of the `assert` -module is not discouraged, and the deprecation caused end user confusion. +module is not discouraged, and the deprecation caused developer confusion. ### DEP0090: Invalid GCM authentication tag lengths **This module is pending deprecation**. Once a replacement API has been -finalized, this module will be fully deprecated. Most end users should +finalized, this module will be fully deprecated. Most developers should **not** have cause to use this module. Users who absolutely must have the functionality that domains provide may rely on it for the time being but should expect to have to migrate to a different solution diff --git a/doc/api/errors.md b/doc/api/errors.md index 7de3ee9da2e58f..1dfc424e2a965e 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -224,7 +224,7 @@ above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation -details of error generation from an end user. For instance: +details of error generation from the user. For instance: ```js function MyError() { From 92a14d3c72f59ddd2e5cde7cce66f16186ab0a83 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Thu, 10 Sep 2020 11:19:44 -0400 Subject: [PATCH 53/73] doc: add technical values document MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As part of the [next-10](https://github.com/nodejs/next-10) we found we needed to capture the project's technical values/priorities as a starting point before discussing key technologies/areas for the next 10 years of Node.js This is a first cut that the team put together. The discussion took place in a few meetings as well as this [PR](https://github.com/nodejs/next-10/pull/11). We believe the doc should live in the core node repository as it is intended to reflect the agreement of the collaborator base. I think this is a good starting point but we also acknowledge that only a small subset of the Node.js collaborators have participated/commented so far. This PR should be a good way to get additional review/input from the larger set of Node.js collaborators. Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/35145 Reviewed-By: Christopher Hiller Reviewed-By: Trivikram Kamat Reviewed-By: Richard Lau Reviewed-By: Beth Griggs Reviewed-By: Anto Aravinth Reviewed-By: Daijiro Wachi Reviewed-By: Stephen Belanger Reviewed-By: Ruy Adorno Reviewed-By: Andrey Pechkurov Reviewed-By: Gireesh Punathil Reviewed-By: Ash Cripps Reviewed-By: Ben Coe Reviewed-By: Rich Trott Reviewed-By: Tobias Nießen Reviewed-By: Joyee Cheung Reviewed-By: Pranshu Srivastava --- README.md | 4 ++- doc/guides/technical-values.md | 62 ++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 doc/guides/technical-values.md diff --git a/README.md b/README.md index 0d2d047ebac29b..ecacab8921ceba 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,7 @@ For information on reporting security vulnerabilities in Node.js, see * [Contributing to the project][] * [Working Groups][] * [Strategic Initiatives][] +* [Technical values and prioritization][] ## Current Project Team Members @@ -633,5 +634,6 @@ Other keys used to sign some previous releases: [Contributing to the project]: CONTRIBUTING.md [Node.js Website]: https://nodejs.org/ [OpenJS Foundation]: https://openjsf.org/ -[Working Groups]: https://github.com/nodejs/TSC/blob/master/WORKING_GROUPS.md [Strategic Initiatives]: https://github.com/nodejs/TSC/blob/master/Strategic-Initiatives.md +[Technical values and prioritization]: doc/guides/technical-values.md +[Working Groups]: https://github.com/nodejs/TSC/blob/master/WORKING_GROUPS.md diff --git a/doc/guides/technical-values.md b/doc/guides/technical-values.md new file mode 100644 index 00000000000000..b912f7610b8471 --- /dev/null +++ b/doc/guides/technical-values.md @@ -0,0 +1,62 @@ +# Technical values and priorities + +The project uses these technical values to establish priorities and guide +collaboration. + +## Values and priority level + +* Priority 1 - Developer experience +* Priority 2 - Stability +* Priority 3 - Operational qualities +* Priority 4 - Node.js maintainer experience +* Priority 5 - Up to date Technology and APIs + +## Value descriptions + +### 1 - Developer experience +We value ensuring that developers are productive and enjoy developing +with Node.js. Some key elements of this include: +* Approachability (both technical and community) +* Great documentation +* Bundling friction-reducing APIs and components, even though + they could be provided externally +* Enabling/supporting external packages to ensure overall developer experience + +### 2 - Stability +Whenever possible, we seek to insure that currently-working code continues to +work. We seek to keep the trust of developers and end-users. Therefore, we value +stability. +Some key elements of this include: +* Backwards compatibility +* Stable releases on a predictable schedule +* A strong safety net, including testing how changes + in Node.js affect popular packages +* Careful consideration of what goes into long term support (LTS) releases + +### 3 - Operational qualities +We value keeping Node.js safe, performant, and lightweight. +We value enabling the ability to investigate and debug problems in +development and production. Some key elements of this include: +* High throughput (speed) +* Fast startup +* Small binary size +* Small memory footprint +* High-quality debugging tools +* Robust diagnostic tools (profilers, etc.) +* Responsible security practices + +### 4 - Node.js maintainer experience +We value the productivity and happiness of the Node.js maintainers. +Some key elements of this include: +* Approachability of the codebase +* Good internal documentation and guides +* Low-friction policies and processes +* Good CI and tooling to make maintainers productive + +### 5 - Up to date Technology and APIs +We value providing developers with modern APIs and technologies +following existing standards whenever possible. +Some key elements of this include: +* Participating in standards work and organizations +* Web API compatibility +* Supporting and exposing new technologies and standards through early adoption From 3d78686987f8742c1e6a492fde9d02be2b6f5aff Mon Sep 17 00:00:00 2001 From: Phillip Johnsen Date: Wed, 16 Sep 2020 22:18:19 +0200 Subject: [PATCH 54/73] build: increase API requests for stale action The second attempt at getting the auto closing of issues & PRs to work as expected without hitting a maximum operations allowed error we've been seeing. Recently discovered that the mentioned error is actually self imposed by the stale action itself. It keeps track of how many outgoing GitHub API requests it performs, and if that count exceeds the configured `operations-per-run` option, it exits to avoid hitting API rate limits. Default `operations-per-run` value is set to `30`. That's a very low limit and we're not at all concerned hitting that rate limit as of now, so we're bumping `operations-per-run` to `500` with these changes. Refs https://github.com/nodejs/node/issues/35144 PR-URL: https://github.com/nodejs/node/pull/35235 Reviewed-By: Mary Marchini Reviewed-By: Daijiro Wachi Reviewed-By: Luigi Pinca --- .github/workflows/close-stalled.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/close-stalled.yml b/.github/workflows/close-stalled.yml index 335a1eea471b70..1834d3ac2e6815 100644 --- a/.github/workflows/close-stalled.yml +++ b/.github/workflows/close-stalled.yml @@ -17,6 +17,8 @@ jobs: close-pr-message: Closing this because it has stalled. Feel free to reopen if this PR is still relevant, or to ping the collaborator who labelled it stalled if you have any questions. # used to filter issues to check whether or not should be closed, avoids hitting maximum operations allowed if needing to paginate through all open issues only-labels: stalled + # max requests it will send per run to the GitHub API before it deliberately exits to avoid hitting API rate limits + operations-per-run: 500 # deactivates automatic removal of stalled label if issue gets any activity remove-stale-when-updated: false # deactivates automatic stale labelling as we prefer to do that manually From 8357b56984729f59031a4584b41284fd1b3b8173 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 31 Aug 2020 23:01:20 -0400 Subject: [PATCH 55/73] test: add wasi readdir() test This commit provides coverage for __wasi_fd_readdir(). PR-URL: https://github.com/nodejs/node/pull/35202 Reviewed-By: Gus Caplan Reviewed-By: Anna Henningsen Reviewed-By: Jiawen Geng --- test/wasi/c/readdir.c | 50 ++++++++++++++++++++++++++++++++++++ test/wasi/test-wasi.js | 5 ++++ test/wasi/wasm/readdir.wasm | Bin 0 -> 36298 bytes 3 files changed, 55 insertions(+) create mode 100644 test/wasi/c/readdir.c create mode 100755 test/wasi/wasm/readdir.wasm diff --git a/test/wasi/c/readdir.c b/test/wasi/c/readdir.c new file mode 100644 index 00000000000000..a18ae5de34eb8f --- /dev/null +++ b/test/wasi/c/readdir.c @@ -0,0 +1,50 @@ +#include +#include +#include +#include +#include +#include + +int main() { + DIR* dir; + struct dirent* entry; + char* platform; + int cnt; + int has_d_type; + + platform = getenv("NODE_PLATFORM"); + assert(platform != NULL); + has_d_type = (0 != strcmp(platform, "aix") && 0 != strcmp(platform, "sunos")); + + dir = opendir("/sandbox"); + assert(dir != NULL); + + cnt = 0; + errno = 0; + while (NULL != (entry = readdir(dir))) { + if (strcmp(entry->d_name, "input.txt") == 0 || + strcmp(entry->d_name, "input2.txt") == 0 || + strcmp(entry->d_name, "notadir") == 0) { + if (has_d_type) { + assert(entry->d_type == DT_REG); + } else { + assert(entry->d_type == DT_UNKNOWN); + } + } else if (strcmp(entry->d_name, "subdir") == 0) { + if (has_d_type) { + assert(entry->d_type == DT_DIR); + } else { + assert(entry->d_type == DT_UNKNOWN); + } + } else { + assert("unexpected file"); + } + + cnt++; + } + + assert(errno == 0); + assert(cnt == 4); + closedir(dir); + return 0; +} diff --git a/test/wasi/test-wasi.js b/test/wasi/test-wasi.js index 8ebc290d7b8269..b4c404e515cbb2 100644 --- a/test/wasi/test-wasi.js +++ b/test/wasi/test-wasi.js @@ -84,6 +84,11 @@ if (process.argv[2] === 'wasi-child') { runWASI({ test: 'notdir' }); runWASI({ test: 'poll' }); runWASI({ test: 'preopen_populates' }); + + if (!common.isWindows && process.platform !== 'android') { + runWASI({ test: 'readdir' }); + } + runWASI({ test: 'read_file', stdout: `hello from input.txt${EOL}` }); runWASI({ test: 'read_file_twice', diff --git a/test/wasi/wasm/readdir.wasm b/test/wasi/wasm/readdir.wasm new file mode 100755 index 0000000000000000000000000000000000000000..ce6cb4999524db243ef569120258fff2a8c23a9f GIT binary patch literal 36298 zcmeI5Ymgk*b>F*tW_EXWX0W{v0K3>Fak~kE07;NbN&+ZI6wx375PVyrW%&s%u|sla z7yFnUfS^rsR}w8zc5KU*{E)1~l=6_{M=VEjEIYDA$ByFcaZwGi#l5>+R;HrRKADj6St^uH9T%TwH1g(KXtP(B}Ng+GaB-U86;H zy}fq+T=Vi$Cn#T|Ndq8HEpB!eI_I8lc7n<^npM{qI?tS2TW_ugL)U1s3rL{9`B~&Klceqpu8oR1!5YPEr2`Xdd zO1K^l4OL2E5Do1vZH3wEpD)+8g5vO6QX9UlJanOXVXggK6x7b0d#1Ute(uSI&1NYa zJ$G(#p|fzVxw=@2hR(s%b|oBgCPDlUbc{~8pb?DKTo8Xo*Fi1&S38~lQZ4+u z;noc_QQyoZp$lBNoJ1}v7pdu5>h-bLIFSS^Ek%Do3N(MTep|8FE9( zuq!1aZrF{SNvc_xjJm2D-AKUN)fz$elLn@q{gNFUS)A<3e$~#$T-`O?E;kncLqP`H zAc^@q?mq=J zJ&d{RD+c2_H|MU)VO;NKll|`c#JT;>okQS^Uy{=8hU|B({Q&^q=u&s%Msg5( z4<3z1+=2L)42PSzansRgS|dy+huop$u)86-*&TK_pGj_^mK($cTdik6Vg7AJ^>4Thl~y)vr_qzM?4yW9yZqw5=J>yQh zGp*$Q?9Z*~S$DrXn>T&HJ%Az$>PYgSjq;!bRZbrABR%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SZuY$8!ioahbFyF*^Jz27-qZfOC>2U-TK^0Y4~6=!iv%=W=J{rGQDVVs zFFmui?iTR8xEyZXyRg3S}?po6a+_Zan8+uX#R3= zX!YXC3ZI@V{>%iU!OYBzE-U_CRfn2CCtL;NqdYH-4hP|EwKg3D)gd0%f+6+Edlrp# z+*MovxuNHcAc%shZddiN`@Cq^J=VKtK`^Ov`>Fcd{PsWZYszWdcR9v+SwBJ5-{!af zd0$gbC;BeOb#6aZf16+a-^bm3`}Di>pMmGbyq(*1?@o2kf?%)C?WgK*^V|QtuPLW{ z`Yw0t+!b?%lrx5|;aBP-{Rthbj|JDd2jBZ71!htyefoo9T�W0n)&bCmBd7Cs-1&}o zzU%0*yWX9hy!XCSr;p5k=$82pp^Hc6FW)kM*`bnXYH;?E)4}QjW}H1jHWg%FovVGN zJP7IkU;Td$yaf(que;jwcjXqJyEN-o+M%;lOl=;z!b3!PTP^bM(CwPHE(7O(0~Fc- AivR!s literal 0 HcmV?d00001 From 64ac5c68aa0e8c32ba54738b91c7ecc7439615e7 Mon Sep 17 00:00:00 2001 From: Turner Jabbour Date: Mon, 14 Sep 2020 21:49:48 -0600 Subject: [PATCH 56/73] doc: fix small grammatical issues in timers.md PR-URL: https://github.com/nodejs/node/pull/35203 Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott --- doc/api/timers.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/doc/api/timers.md b/doc/api/timers.md index f114d0f1766c6e..c3c0e825815b4a 100644 --- a/doc/api/timers.md +++ b/doc/api/timers.md @@ -130,15 +130,14 @@ of the Node.js application. added: v14.9.0 --> -* Returns: {integer} number that can be used to reference this `timeout` - -Coerce a `Timeout` to a primitive, a primitive will be generated that -can be used to clear the `Timeout`. -The generated number can only be used in the same thread where timeout -was created. Therefore to use it cross [`worker_threads`][] it has -to first be passed to a correct thread. -This allows enhanced compatibility with browser's `setTimeout()`, and -`setInterval()` implementations. +* Returns: {integer} a number that can be used to reference this `timeout` + +Coerce a `Timeout` to a primitive. The primitive can be used to +clear the `Timeout`. The primitive can only be used in the +same thread where the timeout was created. Therefore, to use it +across [`worker_threads`][] it must first be passed to the correct +thread. This allows enhanced compatibility with browser +`setTimeout()` and `setInterval()` implementations. ## Scheduling timers From 7f3b2b2a1f2b2fa25adf9c4ea261f2a99ddd74aa Mon Sep 17 00:00:00 2001 From: Gerhard Stoebich <18708370+Flarna@users.noreply.github.com> Date: Tue, 15 Sep 2020 23:04:48 +0200 Subject: [PATCH 57/73] n-api: add more property defaults Add a default value for class method and js like property in enum napi_property_attributes. n-api currently offers only one default which is non configurable, non writable, non enumerable - like Object.defineProperty(). While this is formal correct the usual way to create properties in JS is either by defining a class or use obj.prop = value. The defaults from these variants are now backed into enum values. PR-URL: https://github.com/nodejs/node/pull/35214 Refs: https://github.com/nodejs/node-addon-api/issues/811 Reviewed-By: Anna Henningsen Reviewed-By: Gabriel Schulhof --- doc/api/n-api.md | 18 ++++++++++++++++++ src/js_native_api_types.h | 10 ++++++++++ 2 files changed, 28 insertions(+) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 448ac1c2175cbc..4020add4c2fe64 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -3726,6 +3726,12 @@ if (status != napi_ok) return status; ### Structures #### napi_property_attributes + ```c typedef enum { @@ -3737,6 +3743,14 @@ typedef enum { // Used with napi_define_class to distinguish static properties // from instance properties. Ignored by napi_define_properties. napi_static = 1 << 10, + + // Default for class methods. + napi_default_method = napi_writable | napi_configurable, + + // Default for object properties, like in JS obj[prop]. + napi_default_property = napi_writable | + napi_enumerable | + napi_configurable, } napi_property_attributes; ``` @@ -3755,6 +3769,10 @@ They can be one or more of the following bitflags: * `napi_static`: The property will be defined as a static property on a class as opposed to an instance property, which is the default. This is used only by [`napi_define_class`][]. It is ignored by `napi_define_properties`. +* `napi_default_method`: The property is configureable, writeable but not + enumerable like a method in a JS class. +* `napi_default_property`: The property is writable, enumerable and configurable + like a property set via JS code `obj.key = value`. #### napi_property_descriptor diff --git a/src/js_native_api_types.h b/src/js_native_api_types.h index 115ccebf26132e..7011c80e671a15 100644 --- a/src/js_native_api_types.h +++ b/src/js_native_api_types.h @@ -30,6 +30,16 @@ typedef enum { // Used with napi_define_class to distinguish static properties // from instance properties. Ignored by napi_define_properties. napi_static = 1 << 10, + +#ifdef NAPI_EXPERIMENTAL + // Default for class methods. + napi_default_method = napi_writable | napi_configurable, + + // Default for object properties, like in JS obj[prop]. + napi_default_jsproperty = napi_writable | + napi_enumerable | + napi_configurable, +#endif // NAPI_EXPERIMENTAL } napi_property_attributes; typedef enum { From 2308be06b3ed62e332bb6d8f5757752cfd1c5b97 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 15 Sep 2020 15:11:30 -0700 Subject: [PATCH 58/73] doc: fix header level for error code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/35219 Reviewed-By: Daijiro Wachi Reviewed-By: Michaël Zasso Reviewed-By: Trivikram Kamat --- doc/api/errors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/errors.md b/doc/api/errors.md index 1dfc424e2a965e..40452480782363 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -920,7 +920,7 @@ A `Promise` that was callbackified via `util.callbackify()` was rejected with a falsy value. -#### `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM` +### `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM` From 7610fe500e488ae46ca0282e01ec0dd7458f9e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Wed, 16 Sep 2020 09:02:46 +0200 Subject: [PATCH 59/73] doc: add issue labels sections to release guide PR-URL: https://github.com/nodejs/node/pull/35224 Reviewed-By: Beth Griggs Reviewed-By: Richard Lau Reviewed-By: Daijiro Wachi Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott --- doc/guides/releases.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/doc/guides/releases.md b/doc/guides/releases.md index d4f2a2ac962771..c828a4b2826821 100644 --- a/doc/guides/releases.md +++ b/doc/guides/releases.md @@ -747,6 +747,14 @@ For example: The changes must be made as part of a new semver-minor release. +### Update release labels + +The `lts-watch-vN.x` issue label must be created, with the same color as other +existing labels for that release line, such as `vN.x`. + +If the release is transitioning from Active LTS to Maintenance, the +`backport-requested-vN.x` label must be deleted. + ## Major Releases The process for cutting a new Node.js major release has a number of differences @@ -783,6 +791,21 @@ One month or less before the release date, commits must be cherry-picked into the two branches. To land `SEMVER-MAJOR` at this time requires no objections from the TSC. +### Create release labels + +The following issue labels must be created: + +* `vN.x` +* `backport-blocked-vN.x` +* `backport-open-vN.x` +* `backport-requested-vN.x` +* `backported-to-vN.x` +* `dont-land-on-vN.x` + +The label description can be copied from existing labels of previous releases. +The label color must be the same for all new labels, but different from the +labels of previous releases. + ### Release Proposal A draft release proposal should be created two months before the release. A From 6d4ab3617596a5c0b4cb5fb2550e7e43ffb9972d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerhard=20St=C3=B6bich?= Date: Fri, 18 Sep 2020 22:04:23 +0200 Subject: [PATCH 60/73] doc: update attributes used by n-api samples (#35220) Update n-api samples to create object properties matching to the JS defaults. Using non configurable, non writable properties has its usecases but the JS default for class methods is `configurable` and `writable`. Js properties set by JS code `obj.prop = val` are `configurable`, `writable` and `enumerable`. --- doc/api/n-api.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 4020add4c2fe64..9bc51a536cd2c9 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -1777,8 +1777,16 @@ provided by the addon: ```c napi_value Init(napi_env env, napi_value exports) { napi_status status; - napi_property_descriptor desc = - {"hello", NULL, Method, NULL, NULL, NULL, napi_default, NULL}; + napi_property_descriptor desc = { + "hello", + NULL, + Method, + NULL, + NULL, + NULL, + napi_writable | napi_enumerable | napi_configurable, + NULL + }; status = napi_define_properties(env, exports, 1, &desc); if (status != napi_ok) return NULL; return exports; @@ -1805,7 +1813,7 @@ To define a class so that new instances can be created (often used with napi_value Init(napi_env env, napi_value exports) { napi_status status; napi_property_descriptor properties[] = { - { "value", NULL, NULL, GetValue, SetValue, NULL, napi_default, NULL }, + { "value", NULL, NULL, GetValue, SetValue, NULL, napi_writable | napi_configurable, NULL }, DECLARE_NAPI_METHOD("plusOne", PlusOne), DECLARE_NAPI_METHOD("multiply", Multiply), }; @@ -3714,8 +3722,8 @@ if (status != napi_ok) return status; // Set the properties napi_property_descriptor descriptors[] = { - { "foo", NULL, NULL, NULL, NULL, fooValue, napi_default, NULL }, - { "bar", NULL, NULL, NULL, NULL, barValue, napi_default, NULL } + { "foo", NULL, NULL, NULL, NULL, fooValue, napi_writable | napi_configurable, NULL }, + { "bar", NULL, NULL, NULL, NULL, barValue, napi_writable | napi_configurable, NULL } } status = napi_define_properties(env, obj, From 6119e9511c2eee5a3aae6645d8896cbb80cd5740 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Mon, 14 Sep 2020 17:37:30 -0400 Subject: [PATCH 61/73] doc: clarify use of NAPI_EXPERIMENTAL We've had a few questions about APIs not being available which were related to not having specified `NAPI_EXPERIMENTAL`. Add some additional documentation to explain this common issue: Refs: https://github.com/nodejs/node-addon-api/issues/810 Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/35195 Reviewed-By: Jiawen Geng Reviewed-By: Gabriel Schulhof Reviewed-By: Chengzhong Wu --- doc/api/n-api.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 9bc51a536cd2c9..6fc252c5375a48 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -337,6 +337,18 @@ listed as supporting a later version. version 1 but continued to evolve until Node.js 8.6.0. The API is different in versions prior to Node.js 8.6.0. We recommend N-API version 3 or later. +Each API documented for N-API will have a header named `added in:`, and APIs +which are stable will have the additional header `N-API version:`. +APIs are directly usable when using a Node.js version which supports +the N-API version shown in `N-API version:` or higher. +When using a Node.js version that does not support the +`N-API version:` listed or if there is no `N-API version:` listed, +then the API will only be available if +`#define NAPI_EXPERIMENTAL` precedes the inclusion of `node_api.h` +or `js_native_api.h`. If an API appears not to be available on +a version of Node.js which is later than the one shown in `added in:` then +this is most likely the reason for the apparent absence. + The N-APIs associated strictly with accessing ECMAScript features from native code can be found separately in `js_native_api.h` and `js_native_api_types.h`. The APIs defined in these headers are included in `node_api.h` and From ca1181615e961ec948587aa6f8b7e46efd7cbd71 Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Mon, 14 Sep 2020 17:20:57 -0700 Subject: [PATCH 62/73] n-api: create N-API version 7 Mark `napi_detach_arraybuffer` and `napi_is_detached_arraybuffer` as stable. Signed-off-by: Gabriel Schulhof PR-URL: https://github.com/nodejs/node/pull/35199 Reviewed-By: Colin Ihrig Reviewed-By: Jiawen Geng Reviewed-By: Chengzhong Wu Reviewed-By: Michael Dawson --- doc/api/n-api.md | 8 ++++---- src/js_native_api.h | 7 +++++-- src/node_version.h | 2 +- test/js-native-api/test_general/test.js | 2 +- test/js-native-api/test_typedarray/test_typedarray.c | 1 - 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 6fc252c5375a48..2751dcb23919f4 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -3554,10 +3554,10 @@ defined in [Section 7.2.14][] of the ECMAScript Language Specification. added: - v13.0.0 - v12.16.0 + - v10.22.0 +napiVersion: 7 --> -> Stability: 1 - Experimental - ```c napi_status napi_detach_arraybuffer(napi_env env, napi_value arraybuffer) @@ -3582,10 +3582,10 @@ defined in [Section 24.1.1.3][] of the ECMAScript Language Specification. added: - v13.3.0 - v12.16.0 + - v10.22.0 +napiVersion: 7 --> -> Stability: 1 - Experimental - ```c napi_status napi_is_detached_arraybuffer(napi_env env, napi_value arraybuffer, diff --git a/src/js_native_api.h b/src/js_native_api.h index d0d975c2b454a8..bd8bd35d7b72c9 100644 --- a/src/js_native_api.h +++ b/src/js_native_api.h @@ -17,7 +17,7 @@ // functions available in a new version of N-API that is not yet ported in all // LTS versions, they can set NAPI_VERSION knowing that they have specifically // depended on that version. -#define NAPI_VERSION 6 +#define NAPI_VERSION 7 #endif #endif @@ -529,7 +529,7 @@ NAPI_EXTERN napi_status napi_get_instance_data(napi_env env, void** data); #endif // NAPI_VERSION >= 6 -#ifdef NAPI_EXPERIMENTAL +#if NAPI_VERSION >= 7 // ArrayBuffer detaching NAPI_EXTERN napi_status napi_detach_arraybuffer(napi_env env, napi_value arraybuffer); @@ -537,6 +537,9 @@ NAPI_EXTERN napi_status napi_detach_arraybuffer(napi_env env, NAPI_EXTERN napi_status napi_is_detached_arraybuffer(napi_env env, napi_value value, bool* result); +#endif // NAPI_VERSION >= 7 + +#ifdef NAPI_EXPERIMENTAL // Type tagging NAPI_EXTERN napi_status napi_type_tag_object(napi_env env, napi_value value, diff --git a/src/node_version.h b/src/node_version.h index d68d033f2b57bc..a1ae35cb8776f4 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -93,6 +93,6 @@ // The NAPI_VERSION provided by this version of the runtime. This is the version // which the Node binary being built supports. -#define NAPI_VERSION 6 +#define NAPI_VERSION 7 #endif // SRC_NODE_VERSION_H_ diff --git a/test/js-native-api/test_general/test.js b/test/js-native-api/test_general/test.js index de06aecb590529..4dbdc37c918c37 100644 --- a/test/js-native-api/test_general/test.js +++ b/test/js-native-api/test_general/test.js @@ -33,7 +33,7 @@ assert.notStrictEqual(test_general.testGetPrototype(baseObject), test_general.testGetPrototype(extendedObject)); // Test version management functions -assert.strictEqual(test_general.testGetVersion(), 6); +assert.strictEqual(test_general.testGetVersion(), 7); [ 123, diff --git a/test/js-native-api/test_typedarray/test_typedarray.c b/test/js-native-api/test_typedarray/test_typedarray.c index 66b1f9019c04ea..1714b5fe717f87 100644 --- a/test/js-native-api/test_typedarray/test_typedarray.c +++ b/test/js-native-api/test_typedarray/test_typedarray.c @@ -1,4 +1,3 @@ -#define NAPI_EXPERIMENTAL #include #include #include From d195d20dbc70b8c75037f90f7bbfe31dc5273bf5 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 13 Jul 2020 22:03:35 -0700 Subject: [PATCH 63/73] doc: relax prohibition on personal pronouns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Our personal pronoun prohibition is contrary to most current technical documentation style guides. The prohibition on personal pronouns comes from academic style guides. It results in an unnecessary formal tone. It encourages wordiness and the overuse of passive voice. This change to our style guide more closely aligns us with the style guides of companies like Google, IBM, and Microsoft. Google's style guide suggests avoiding first-person pronouns and suggests: "Use the second-person pronoun (_you_) whenever possible." Refs: https://developers.google.com/style/pronouns#personal-pronouns IBM's style guide also recommends second-person voice ("Use second person ('you')"). Refs: https://www.ibm.com/developerworks/library/styleguidelines/index.html Similarly, Microsoft's style guide recommends using first person sparingly and avoiding first-person plural. "In general, use second person". Refs: https://docs.microsoft.com/en-us/style-guide/grammar/person#in-general-use-second-person PR-URL: https://github.com/nodejs/node/pull/34353 Reviewed-By: Ben Noordhuis Reviewed-By: Michaël Zasso Reviewed-By: Anna Henningsen Reviewed-By: Richard Lau Reviewed-By: Mary Marchini Reviewed-By: Denys Otrishko Reviewed-By: Trivikram Kamat --- doc/guides/doc-style-guide.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/guides/doc-style-guide.md b/doc/guides/doc-style-guide.md index 5e4f8db3ddb071..b44206ff9e2791 100644 --- a/doc/guides/doc-style-guide.md +++ b/doc/guides/doc-style-guide.md @@ -19,11 +19,11 @@ this guide. * Check changes to documentation with `make lint-md`. * [Use US spelling][]. * [Use serial commas][]. -* Avoid personal pronouns (_I_, _you_, _we_) in reference documentation. - * Personal pronouns are acceptable in colloquial documentation such as guides. - * Use gender-neutral pronouns and gender-neutral plural nouns. - * OK: _they_, _their_, _them_, _folks_, _people_, _developers_ - * NOT OK: _his_, _hers_, _him_, _her_, _guys_, _dudes_ +* Avoid first-person pronouns (_I_, _we_). + * Exception: _we recommend foo_ is preferable to _foo is recommended_. +* Use gender-neutral pronouns and gender-neutral plural nouns. + * OK: _they_, _their_, _them_, _folks_, _people_, _developers_ + * NOT OK: _his_, _hers_, _him_, _her_, _guys_, _dudes_ * When combining wrapping elements (parentheses and quotes), place terminal punctuation: * Inside the wrapping element if the wrapping element contains a complete From b9161f408f4a311cfada8f354792e547bfc526a6 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 16 Sep 2020 06:29:28 -0700 Subject: [PATCH 64/73] doc: sort repl references in ASCII order PR-URL: https://github.com/nodejs/node/pull/35230 Reviewed-By: Daijiro Wachi Reviewed-By: Luigi Pinca Reviewed-By: Masashi Hirano Reviewed-By: Trivikram Kamat Reviewed-By: Anna Henningsen --- doc/api/repl.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/repl.md b/doc/api/repl.md index e3daa00da8ea35..8f3f6c41c5b2b7 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -744,18 +744,18 @@ a `net.Server` and `net.Socket` instance, see: For an example of running a REPL instance over [`curl(1)`][], see: . +[TTY keybindings]: readline.html#readline_tty_keybindings [ZSH]: https://en.wikipedia.org/wiki/Z_shell [`'uncaughtException'`]: process.html#process_event_uncaughtexception [`--experimental-repl-await`]: cli.html#cli_experimental_repl_await [`ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE`]: errors.html#errors_err_domain_cannot_set_uncaught_exception_capture [`ERR_INVALID_REPL_INPUT`]: errors.html#errors_err_invalid_repl_input +[`curl(1)`]: https://curl.haxx.se/docs/manpage.html [`domain`]: domain.html [`process.setUncaughtExceptionCaptureCallback()`]: process.html#process_process_setuncaughtexceptioncapturecallback_fn [`readline.InterfaceCompleter`]: readline.html#readline_use_of_the_completer_function [`repl.ReplServer`]: #repl_class_replserver [`repl.start()`]: #repl_repl_start_options -[`util.inspect()`]: util.html#util_util_inspect_object_options [`reverse-i-search`]: #repl_reverse_i_search -[TTY keybindings]: readline.html#readline_tty_keybindings -[`curl(1)`]: https://curl.haxx.se/docs/manpage.html +[`util.inspect()`]: util.html#util_util_inspect_object_options [stream]: stream.html From b62d9b47be35a12a5eb95cf106a26a8d9dcfcada Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 16 Sep 2020 12:57:32 -0700 Subject: [PATCH 65/73] doc: remove excessive formatting in dgram.md PR-URL: https://github.com/nodejs/node/pull/35234 Reviewed-By: Anna Henningsen Reviewed-By: Trivikram Kamat --- doc/api/dgram.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/api/dgram.md b/doc/api/dgram.md index 53f3e330a6aa82..3ed4e55e2a6485 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -520,25 +520,25 @@ client.connect(41234, 'localhost', (err) => { #### Note about UDP datagram size -The maximum size of an `IPv4/v6` datagram depends on the `MTU` -(_Maximum Transmission Unit_) and on the `Payload Length` field size. +The maximum size of an IPv4/v6 datagram depends on the `MTU` +(Maximum Transmission Unit) and on the `Payload Length` field size. -* The `Payload Length` field is `16 bits` wide, which means that a normal - payload cannot exceed 64K octets _including_ the internet header and data +* The `Payload Length` field is 16 bits wide, which means that a normal + payload cannot exceed 64K octets including the internet header and data (65,507 bytes = 65,535 − 8 bytes UDP header − 20 bytes IP header); this is generally true for loopback interfaces, but such long datagram messages are impractical for most hosts and networks. * The `MTU` is the largest size a given link layer technology can support for - datagram messages. For any link, `IPv4` mandates a minimum `MTU` of `68` - octets, while the recommended `MTU` for IPv4 is `576` (typically recommended + datagram messages. For any link, IPv4 mandates a minimum `MTU` of 68 + octets, while the recommended `MTU` for IPv4 is 576 (typically recommended as the `MTU` for dial-up type applications), whether they arrive whole or in fragments. - For `IPv6`, the minimum `MTU` is `1280` octets, however, the mandatory minimum - fragment reassembly buffer size is `1500` octets. The value of `68` octets is + For IPv6, the minimum `MTU` is 1280 octets. However, the mandatory minimum + fragment reassembly buffer size is 1500 octets. The value of 68 octets is very small, since most current link layer technologies, like Ethernet, have a - minimum `MTU` of `1500`. + minimum `MTU` of 1500. It is impossible to know in advance the MTU of each link through which a packet might travel. Sending a datagram greater than the receiver `MTU` will From 2bc335dcf633d0fb7d88a79fa63fb23c53b0ac4f Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 18 Sep 2020 02:27:44 -0700 Subject: [PATCH 66/73] doc: clarify napi_property_attributes text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Rearrange sentence to avoid ambiguity whether the entire sentence applies to a method in a JS class or just the "but not" part * Use serial comma * Correct spelling of _configurable_ PR-URL: https://github.com/nodejs/node/pull/35253 Reviewed-By: Chengzhong Wu Reviewed-By: Michael Dawson Reviewed-By: Gerhard Stöbich Reviewed-By: Luigi Pinca Reviewed-By: Anna Henningsen --- doc/api/n-api.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 2751dcb23919f4..14ce21fb46483a 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -3789,10 +3789,10 @@ They can be one or more of the following bitflags: * `napi_static`: The property will be defined as a static property on a class as opposed to an instance property, which is the default. This is used only by [`napi_define_class`][]. It is ignored by `napi_define_properties`. -* `napi_default_method`: The property is configureable, writeable but not - enumerable like a method in a JS class. -* `napi_default_property`: The property is writable, enumerable and configurable - like a property set via JS code `obj.key = value`. +* `napi_default_method`: Like a method in a JS class, the property is + configurable and writeable, but not enumerable. +* `napi_default_property`: Like a property set via assignment in JavaScript, the + property is writable, enumerable, and configurable. #### napi_property_descriptor From e29e2daf4c04e3c3d8cb555a7babdb7fb97081f9 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 15 Sep 2020 14:33:00 -0700 Subject: [PATCH 67/73] test: improve assertions in pummel/test-timers * Timers should not fire early. Check for that. * Allow the wiggle-room to increase on subsequent iterations of intervals. PR-URL: https://github.com/nodejs/node/pull/35216 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Andrey Pechkurov Reviewed-By: Anto Aravinth --- test/pummel/test-timers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/pummel/test-timers.js b/test/pummel/test-timers.js index d5d992f7b9a552..2f5580840231e3 100644 --- a/test/pummel/test-timers.js +++ b/test/pummel/test-timers.js @@ -36,7 +36,7 @@ const WINDOW = 200; // Why does this need to be so big? assert.ok(diff > 0); console.error(`diff: ${diff}`); - assert.strictEqual(1000 - WINDOW < diff && diff < 1000 + WINDOW, true); + assert.ok(1000 <= diff && diff < 1000 + WINDOW); }), 1000); } @@ -61,7 +61,7 @@ const WINDOW = 200; // Why does this need to be so big? const t = interval_count * 1000; - assert.ok(t - WINDOW < diff && diff < t + WINDOW, `t: ${t}`); + assert.ok(t <= diff && diff < t + (WINDOW * interval_count)); assert.ok(interval_count <= 3, `interval_count: ${interval_count}`); if (interval_count === 3) From d82dd0c77330b82ce9d232aafccdc6f02d832f1f Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 17 Sep 2020 11:50:31 -0700 Subject: [PATCH 68/73] doc: revise stability section of values doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the section a bit shorter and comply with minor elements of Microsoft Style Guide. PR-URL: https://github.com/nodejs/node/pull/35242 Reviewed-By: Mary Marchini Reviewed-By: Michaël Zasso Reviewed-By: Daijiro Wachi --- doc/guides/technical-values.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/guides/technical-values.md b/doc/guides/technical-values.md index b912f7610b8471..a688c0b21fe412 100644 --- a/doc/guides/technical-values.md +++ b/doc/guides/technical-values.md @@ -23,9 +23,8 @@ with Node.js. Some key elements of this include: * Enabling/supporting external packages to ensure overall developer experience ### 2 - Stability -Whenever possible, we seek to insure that currently-working code continues to -work. We seek to keep the trust of developers and end-users. Therefore, we value -stability. +Whenever possible, we seek to ensure that working code continues to work. To +keep the trust of developers and users, we value stability. Some key elements of this include: * Backwards compatibility * Stable releases on a predictable schedule From b860a7f61ced68f72b16c1385a0a9bfe29a35591 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 17 Sep 2020 11:58:30 -0700 Subject: [PATCH 69/73] doc: standardize on _backward_ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We use _backward incompatible_ and _backwards incompatible_ with no discernible pattern in the docs. Follow Chicago Manual of Style and also our standardization on US English and favor _backward_. PR-URL: https://github.com/nodejs/node/pull/35243 Reviewed-By: Michaël Zasso Reviewed-By: Michael Dawson --- doc/api/cluster.md | 2 +- doc/api/crypto.md | 2 +- doc/api/process.md | 2 +- doc/api/readline.md | 2 +- doc/api/repl.md | 4 ++-- doc/guides/technical-values.md | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/api/cluster.md b/doc/api/cluster.md index 1ed5e38670fb3c..92e4d42d60e3fd 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -436,7 +436,7 @@ If the graceful disconnect behavior is not needed, use `worker.process.kill()`. Causes `.exitedAfterDisconnect` to be set. -This method is aliased as `worker.destroy()` for backwards compatibility. +This method is aliased as `worker.destroy()` for backward compatibility. In a worker, `process.kill()` exists, but it is not this function; it is [`kill()`][]. diff --git a/doc/api/crypto.md b/doc/api/crypto.md index d4e4e10596e215..329f32bdeb1d80 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1602,7 +1602,7 @@ The default encoding to use for functions that can take either strings or [buffers][`Buffer`]. The default value is `'buffer'`, which makes methods default to [`Buffer`][] objects. -The `crypto.DEFAULT_ENCODING` mechanism is provided for backwards compatibility +The `crypto.DEFAULT_ENCODING` mechanism is provided for backward compatibility with legacy programs that expect `'latin1'` to be the default encoding. New applications should expect the default to be `'buffer'`. diff --git a/doc/api/process.md b/doc/api/process.md index 385f0c30feb4eb..03733b2c7e8e4c 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -2320,7 +2320,7 @@ important ways: * Pipes (and sockets): *synchronous* on Windows, *asynchronous* on POSIX These behaviors are partly for historical reasons, as changing them would -create backwards incompatibility, but they are also expected by some users. +create backward incompatibility, but they are also expected by some users. Synchronous writes avoid problems such as output written with `console.log()` or `console.error()` being unexpectedly interleaved, or not written at all if diff --git a/doc/api/readline.md b/doc/api/readline.md index af5e3147d41f4d..8d3eef1ab42aee 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -828,7 +828,7 @@ const { createInterface } = require('readline'); ctrl + w or ctrl + backspace - Delete backwards to a word boundary + Delete backward to a word boundary ctrl + backspace Doesn't work on Linux, Mac and Windows diff --git a/doc/api/repl.md b/doc/api/repl.md index 8f3f6c41c5b2b7..fe8115a9536377 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -246,8 +246,8 @@ added: v13.6.0 --> The REPL supports bi-directional reverse-i-search similar to [ZSH][]. It is -triggered with ` + R` to search backwards and ` + S` to search -forwards. +triggered with ` + R` to search backward and ` + S` to search +forward. Duplicated history entires will be skipped. diff --git a/doc/guides/technical-values.md b/doc/guides/technical-values.md index a688c0b21fe412..d79fde6a461021 100644 --- a/doc/guides/technical-values.md +++ b/doc/guides/technical-values.md @@ -26,7 +26,7 @@ with Node.js. Some key elements of this include: Whenever possible, we seek to ensure that working code continues to work. To keep the trust of developers and users, we value stability. Some key elements of this include: -* Backwards compatibility +* Backward compatibility * Stable releases on a predictable schedule * A strong safety net, including testing how changes in Node.js affect popular packages From 4f4faa8e3c4bae5a499e69fb177ec23ef3566f71 Mon Sep 17 00:00:00 2001 From: DrunkenPoney Date: Sat, 19 Sep 2020 05:33:49 -0400 Subject: [PATCH 70/73] readline: fix key name for function keys with modifiers Fixes: https://github.com/nodejs/node/issues/35251 PR-URL: https://github.com/nodejs/node/pull/35268 Reviewed-By: Anna Henningsen Reviewed-By: Joyee Cheung Reviewed-By: Rich Trott --- lib/internal/readline/utils.js | 11 ++++++++++- test/parallel/test-readline-keys.js | 24 +++++++++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/lib/internal/readline/utils.js b/lib/internal/readline/utils.js index 0b9fe8cde4f5ce..d75b64dd46beac 100644 --- a/lib/internal/readline/utils.js +++ b/lib/internal/readline/utils.js @@ -199,7 +199,13 @@ function* emitKeys(stream) { // Parse the key itself switch (code) { - /* xterm/gnome ESC O letter */ + /* xterm/gnome ESC [ letter (with modifier) */ + case '[P': key.name = 'f1'; break; + case '[Q': key.name = 'f2'; break; + case '[R': key.name = 'f3'; break; + case '[S': key.name = 'f4'; break; + + /* xterm/gnome ESC O letter (without modifier) */ case 'OP': key.name = 'f1'; break; case 'OQ': key.name = 'f2'; break; case 'OR': key.name = 'f3'; break; @@ -296,12 +302,15 @@ function* emitKeys(stream) { } else if (ch === '\r') { // carriage return key.name = 'return'; + key.meta = escaped; } else if (ch === '\n') { // Enter, should have been called linefeed key.name = 'enter'; + key.meta = escaped; } else if (ch === '\t') { // tab key.name = 'tab'; + key.meta = escaped; } else if (ch === '\b' || ch === '\x7f') { // backspace or ctrl+h key.name = 'backspace'; diff --git a/test/parallel/test-readline-keys.js b/test/parallel/test-readline-keys.js index f0162ab06b8f38..bdc93c148edbfe 100644 --- a/test/parallel/test-readline-keys.js +++ b/test/parallel/test-readline-keys.js @@ -92,10 +92,13 @@ addTest('io.JS', [ ]); // Named characters -addTest('\n\r\t', [ +addTest('\n\r\t\x1b\n\x1b\r\x1b\t', [ { name: 'enter', sequence: '\n' }, { name: 'return', sequence: '\r' }, { name: 'tab', sequence: '\t' }, + { name: 'enter', sequence: '\x1b\n', meta: true }, + { name: 'return', sequence: '\x1b\r', meta: true }, + { name: 'tab', sequence: '\x1b\t', meta: true }, ]); // Space and backspace @@ -132,6 +135,25 @@ addTest('a\x1baA\x1bA', [ { name: 'a', sequence: '\x1bA', meta: true, shift: true }, ]); +// xterm/gnome ESC [ letter (with modifiers) +/* eslint-disable max-len */ +addTest('\x1b[2P\x1b[3P\x1b[4P\x1b[5P\x1b[6P\x1b[7P\x1b[8P\x1b[3Q\x1b[8Q\x1b[3R\x1b[8R\x1b[3S\x1b[8S', [ + { name: 'f1', sequence: '\x1b[2P', code: '[P', shift: true, meta: false, ctrl: false }, + { name: 'f1', sequence: '\x1b[3P', code: '[P', shift: false, meta: true, ctrl: false }, + { name: 'f1', sequence: '\x1b[4P', code: '[P', shift: true, meta: true, ctrl: false }, + { name: 'f1', sequence: '\x1b[5P', code: '[P', shift: false, meta: false, ctrl: true }, + { name: 'f1', sequence: '\x1b[6P', code: '[P', shift: true, meta: false, ctrl: true }, + { name: 'f1', sequence: '\x1b[7P', code: '[P', shift: false, meta: true, ctrl: true }, + { name: 'f1', sequence: '\x1b[8P', code: '[P', shift: true, meta: true, ctrl: true }, + { name: 'f2', sequence: '\x1b[3Q', code: '[Q', meta: true }, + { name: 'f2', sequence: '\x1b[8Q', code: '[Q', shift: true, meta: true, ctrl: true }, + { name: 'f3', sequence: '\x1b[3R', code: '[R', meta: true }, + { name: 'f3', sequence: '\x1b[8R', code: '[R', shift: true, meta: true, ctrl: true }, + { name: 'f4', sequence: '\x1b[3S', code: '[S', meta: true }, + { name: 'f4', sequence: '\x1b[8S', code: '[S', shift: true, meta: true, ctrl: true }, +]); +/* eslint-enable max-len */ + // xterm/gnome ESC O letter addTest('\x1bOP\x1bOQ\x1bOR\x1bOS', [ { name: 'f1', sequence: '\x1bOP', code: 'OP' }, From d8b57140b4c60cc0920883addc4bc05ea3477b8f Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sat, 19 Sep 2020 01:38:03 +0200 Subject: [PATCH 71/73] https: set requestTimeout default to 0 Fixes: https://github.com/nodejs/node/issues/35261 PR-URL: https://github.com/nodejs/node/pull/35264 Reviewed-By: Matteo Collina Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca Reviewed-By: Beth Griggs Reviewed-By: Rich Trott --- lib/_http_server.js | 2 +- lib/https.js | 2 +- .../test-https-server-request-timeout.js | 21 +++++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 test/parallel/test-https-server-request-timeout.js diff --git a/lib/_http_server.js b/lib/_http_server.js index a88900aaf33e03..8fa2aff627bc48 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -364,7 +364,7 @@ function Server(options, requestListener) { this.keepAliveTimeout = 5000; this.maxHeadersCount = null; this.headersTimeout = 60 * 1000; // 60 seconds - this.requestTimeout = 0; // 120 seconds + this.requestTimeout = 0; } ObjectSetPrototypeOf(Server.prototype, net.Server.prototype); ObjectSetPrototypeOf(Server, net.Server); diff --git a/lib/https.js b/lib/https.js index 4b21977fe48c3a..6aafef6cb639e1 100644 --- a/lib/https.js +++ b/lib/https.js @@ -80,7 +80,7 @@ function Server(opts, requestListener) { this.keepAliveTimeout = 5000; this.maxHeadersCount = null; this.headersTimeout = 60 * 1000; // 60 seconds - this.requestTimeout = 120 * 1000; // 120 seconds + this.requestTimeout = 0; } ObjectSetPrototypeOf(Server.prototype, tls.Server.prototype); ObjectSetPrototypeOf(Server, tls.Server); diff --git a/test/parallel/test-https-server-request-timeout.js b/test/parallel/test-https-server-request-timeout.js new file mode 100644 index 00000000000000..66a1cb9f25f82e --- /dev/null +++ b/test/parallel/test-https-server-request-timeout.js @@ -0,0 +1,21 @@ +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const assert = require('assert'); +const { createServer } = require('https'); +const fixtures = require('../common/fixtures'); + +const options = { + key: fixtures.readKey('agent1-key.pem'), + cert: fixtures.readKey('agent1-cert.pem') +}; + +const server = createServer(options); + +// 0 seconds is the default +assert.strictEqual(server.requestTimeout, 0); +const requestTimeout = common.platformTimeout(1000); +server.requestTimeout = requestTimeout; +assert.strictEqual(server.requestTimeout, requestTimeout); From 836680a4eaf375a153afdb8e79ded28355fbf520 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 11 Sep 2020 21:27:52 -0700 Subject: [PATCH 72/73] doc: use present tense in error messages Error messages are a mix of present and past tense. They should be mostly or entirely present tense. This eliminates the past tense constructions "was found" and "were found". Backport-PR-URL: https://github.com/nodejs/node/pull/35247 PR-URL: https://github.com/nodejs/node/pull/35164 Reviewed-By: Anna Henningsen Reviewed-By: Denys Otrishko Reviewed-By: Derek Lewis Reviewed-By: Luigi Pinca --- doc/api/errors.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/errors.md b/doc/api/errors.md index 40452480782363..1041d10b5c4129 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -1391,7 +1391,7 @@ An invalid or unknown file encoding was passed. ### `ERR_INVALID_PACKAGE_CONFIG` -An invalid `package.json` file was found which failed parsing. +An invalid `package.json` file failed parsing. ### `ERR_INVALID_PACKAGE_TARGET` @@ -1608,8 +1608,8 @@ is thrown if a required option is missing. ### `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST` An object that needs to be explicitly listed in the `transferList` argument -was found in the object passed to a `postMessage()` call, but not provided in -the `transferList` for that call. Usually, this is a `MessagePort`. +is in the object passed to a `postMessage()` call, but is not provided +in the `transferList` for that call. Usually, this is a `MessagePort`. ### `ERR_MISSING_PASSPHRASE` @@ -2092,7 +2092,7 @@ import 'package-name'; // supported ### `ERR_VALID_PERFORMANCE_ENTRY_TYPE` While using the Performance Timing API (`perf_hooks`), no valid performance -entry types were found. +entry types are found. ### `ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING` From efd5c83255d77b741cbdd485cdf5926c0447f233 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Mon, 21 Sep 2020 15:53:36 -0400 Subject: [PATCH 73/73] 2020-09-22, Version 14.12.0 (Current) Notable changes: - deps: - update to uvwasi 0.0.11 (Colin Ihrig) [#35104](https://github.com/nodejs/node/pull/35104) - n-api: - create N-API version 7 (Gabriel Schulhof) [#35199](https://github.com/nodejs/node/pull/35199) - add more property defaults (Gerhard Stoebich) [#35214](https://github.com/nodejs/node/pull/35214) PR-URL: https://github.com/nodejs/node/pull/35285 --- CHANGELOG.md | 3 +- doc/api/fs.md | 20 ++++---- doc/api/n-api.md | 2 +- doc/changelogs/CHANGELOG_V14.md | 85 +++++++++++++++++++++++++++++++++ src/node_version.h | 6 +-- 5 files changed, 101 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6980334356b3b..079a83e9778817 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,8 @@ release. -14.11.0
+14.12.0
+14.11.0
14.10.1
14.10.0
14.9.0
diff --git a/doc/api/fs.md b/doc/api/fs.md index 41b635b78afcf7..bafdcc4ef561d9 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -4147,7 +4147,7 @@ This happens when: diff --git a/doc/changelogs/CHANGELOG_V14.md b/doc/changelogs/CHANGELOG_V14.md index 86bda5aa6ef8fe..e26fc41877f30c 100644 --- a/doc/changelogs/CHANGELOG_V14.md +++ b/doc/changelogs/CHANGELOG_V14.md @@ -43,6 +43,91 @@ * [io.js](CHANGELOG_IOJS.md) * [Archive](CHANGELOG_ARCHIVE.md) + +## 2020-09-22, Version 14.12.0 (Current), @ruyadorno + +### Notable changes + +* **deps**: + * update to uvwasi 0.0.11 (Colin Ihrig) [#35104](https://github.com/nodejs/node/pull/35104) +* **n-api**: + * create N-API version 7 (Gabriel Schulhof) [#35199](https://github.com/nodejs/node/pull/35199) + * add more property defaults (Gerhard Stoebich) [#35214](https://github.com/nodejs/node/pull/35214) + +### Commits +* [[`5229ffadcf`](https://github.com/nodejs/node/commit/5229ffadcf)] - **buffer**: adjust validation to account for buffer.kMaxLength (Anna Henningsen) [#35134](https://github.com/nodejs/node/pull/35134) +* [[`3d78686987`](https://github.com/nodejs/node/commit/3d78686987)] - **build**: increase API requests for stale action (Phillip Johnsen) [#35235](https://github.com/nodejs/node/pull/35235) +* [[`f2cc1c22c1`](https://github.com/nodejs/node/commit/f2cc1c22c1)] - **build**: filter issues & PRs to auto close by matching on stalled label (Phillip Johnsen) [#35159](https://github.com/nodejs/node/pull/35159) +* [[`f3c45a1cef`](https://github.com/nodejs/node/commit/f3c45a1cef)] - ***Revert*** "**build**: require "allow edits" to be checked" (Rich Trott) [#35094](https://github.com/nodejs/node/pull/35094) +* [[`1bb0ed3c6a`](https://github.com/nodejs/node/commit/1bb0ed3c6a)] - **crypto**: improve invalid arg type message for randomInt() (Rich Trott) [#35089](https://github.com/nodejs/node/pull/35089) +* [[`3573545315`](https://github.com/nodejs/node/commit/3573545315)] - **crypto**: improve randomInt out-of-range error message (Rich Trott) [#35088](https://github.com/nodejs/node/pull/35088) +* [[`d4389b59b4`](https://github.com/nodejs/node/commit/d4389b59b4)] - **deps**: update to uvwasi 0.0.11 (Colin Ihrig) [#35104](https://github.com/nodejs/node/pull/35104) +* [[`836680a4ea`](https://github.com/nodejs/node/commit/836680a4ea)] - **doc**: use present tense in error messages (Rich Trott) [#35164](https://github.com/nodejs/node/pull/35164) +* [[`b860a7f61c`](https://github.com/nodejs/node/commit/b860a7f61c)] - **doc**: standardize on \_backward\_ (Rich Trott) [#35243](https://github.com/nodejs/node/pull/35243) +* [[`d82dd0c773`](https://github.com/nodejs/node/commit/d82dd0c773)] - **doc**: revise stability section of values doc (Rich Trott) [#35242](https://github.com/nodejs/node/pull/35242) +* [[`2bc335dcf6`](https://github.com/nodejs/node/commit/2bc335dcf6)] - **doc**: clarify napi\_property\_attributes text (Rich Trott) [#35253](https://github.com/nodejs/node/pull/35253) +* [[`b62d9b47be`](https://github.com/nodejs/node/commit/b62d9b47be)] - **doc**: remove excessive formatting in dgram.md (Rich Trott) [#35234](https://github.com/nodejs/node/pull/35234) +* [[`b9161f408f`](https://github.com/nodejs/node/commit/b9161f408f)] - **doc**: sort repl references in ASCII order (Rich Trott) [#35230](https://github.com/nodejs/node/pull/35230) +* [[`d195d20dbc`](https://github.com/nodejs/node/commit/d195d20dbc)] - **doc**: relax prohibition on personal pronouns (Rich Trott) [#34353](https://github.com/nodejs/node/pull/34353) +* [[`6119e9511c`](https://github.com/nodejs/node/commit/6119e9511c)] - **doc**: clarify use of NAPI\_EXPERIMENTAL (Michael Dawson) [#35195](https://github.com/nodejs/node/pull/35195) +* [[`6d4ab36175`](https://github.com/nodejs/node/commit/6d4ab36175)] - **doc**: update attributes used by n-api samples (#35220) (Gerhard Stoebich) +* [[`7610fe500e`](https://github.com/nodejs/node/commit/7610fe500e)] - **doc**: add issue labels sections to release guide (Michaël Zasso) [#35224](https://github.com/nodejs/node/pull/35224) +* [[`2308be06b3`](https://github.com/nodejs/node/commit/2308be06b3)] - **doc**: fix header level for error code (Rich Trott) [#35219](https://github.com/nodejs/node/pull/35219) +* [[`64ac5c68aa`](https://github.com/nodejs/node/commit/64ac5c68aa)] - **doc**: fix small grammatical issues in timers.md (Turner Jabbour) [#35203](https://github.com/nodejs/node/pull/35203) +* [[`92a14d3c72`](https://github.com/nodejs/node/commit/92a14d3c72)] - **doc**: add technical values document (Michael Dawson) [#35145](https://github.com/nodejs/node/pull/35145) +* [[`dbfd3b261d`](https://github.com/nodejs/node/commit/dbfd3b261d)] - **doc**: remove "end user" (Rich Trott) [#35200](https://github.com/nodejs/node/pull/35200) +* [[`c1c93a6cde`](https://github.com/nodejs/node/commit/c1c93a6cde)] - **doc**: use command-line/command line consistently (Rich Trott) [#35198](https://github.com/nodejs/node/pull/35198) +* [[`70ec369b76`](https://github.com/nodejs/node/commit/70ec369b76)] - **doc**: replace "you should do X" with "do X" (Rich Trott) [#35194](https://github.com/nodejs/node/pull/35194) +* [[`e5fffe2f8f`](https://github.com/nodejs/node/commit/e5fffe2f8f)] - **doc**: fix missing word in dgram.md (Tom Atkinson) [#35231](https://github.com/nodejs/node/pull/35231) +* [[`c1e16d15dd`](https://github.com/nodejs/node/commit/c1e16d15dd)] - **doc**: fix deprecation documentation inconsistencies (Antoine du HAMEL) [#35082](https://github.com/nodejs/node/pull/35082) +* [[`910deff2de`](https://github.com/nodejs/node/commit/910deff2de)] - **doc**: fix broken link in crypto.md (Rich Trott) [#35181](https://github.com/nodejs/node/pull/35181) +* [[`066148d229`](https://github.com/nodejs/node/commit/066148d229)] - **doc**: remove problematic auto-linking of curl man pages (Rich Trott) [#35174](https://github.com/nodejs/node/pull/35174) +* [[`aea3f77c8d`](https://github.com/nodejs/node/commit/aea3f77c8d)] - **doc**: update eventLoopUtilization documentation (Anna Henningsen) [#35155](https://github.com/nodejs/node/pull/35155) +* [[`32d1731ae1`](https://github.com/nodejs/node/commit/32d1731ae1)] - **doc**: update process.release (schamberg97) [#35167](https://github.com/nodejs/node/pull/35167) +* [[`176e9e4054`](https://github.com/nodejs/node/commit/176e9e4054)] - **doc**: fix broken links in modules.md (Rich Trott) [#35182](https://github.com/nodejs/node/pull/35182) +* [[`dc4c5696da`](https://github.com/nodejs/node/commit/dc4c5696da)] - **doc**: add missing copyFile change history (Shelley Vohr) [#35056](https://github.com/nodejs/node/pull/35056) +* [[`e8d479ed67`](https://github.com/nodejs/node/commit/e8d479ed67)] - **doc**: perform cleanup on security-release-process.md (Rich Trott) [#35154](https://github.com/nodejs/node/pull/35154) +* [[`99785e48ea`](https://github.com/nodejs/node/commit/99785e48ea)] - **doc**: fix minor punctuation issue in path.md (Amila Welihinda) [#35127](https://github.com/nodejs/node/pull/35127) +* [[`ae85228e54`](https://github.com/nodejs/node/commit/ae85228e54)] - **doc**: perform minor cleanup on cli.md (Rich Trott) [#35152](https://github.com/nodejs/node/pull/35152) +* [[`e4105140e7`](https://github.com/nodejs/node/commit/e4105140e7)] - **doc**: improve table accessibility (Rich Trott) [#35146](https://github.com/nodejs/node/pull/35146) +* [[`7dbcd24541`](https://github.com/nodejs/node/commit/7dbcd24541)] - **doc**: fix left nav color contrast (Rich Trott) [#35141](https://github.com/nodejs/node/pull/35141) +* [[`331142ca25`](https://github.com/nodejs/node/commit/331142ca25)] - **doc**: update contact info for Ash Cripps (Ash Cripps) [#35139](https://github.com/nodejs/node/pull/35139) +* [[`df70861863`](https://github.com/nodejs/node/commit/df70861863)] - **doc**: simplify circular dependencies text in modules.md (Rich Trott) [#35126](https://github.com/nodejs/node/pull/35126) +* [[`f4e714aaf5`](https://github.com/nodejs/node/commit/f4e714aaf5)] - **doc**: update my email address (Michael Dawson) [#35121](https://github.com/nodejs/node/pull/35121) +* [[`46b9f4b376`](https://github.com/nodejs/node/commit/46b9f4b376)] - **doc**: add missing changes entry for breakEvalOnSigint REPL option (Anna Henningsen) [#35143](https://github.com/nodejs/node/pull/35143) +* [[`122edad98b`](https://github.com/nodejs/node/commit/122edad98b)] - **doc**: update security process (Michael Dawson) [#35107](https://github.com/nodejs/node/pull/35107) +* [[`aa93c1c22d`](https://github.com/nodejs/node/commit/aa93c1c22d)] - **doc**: fix broken link in perf\_hooks.md (Rich Trott) [#35113](https://github.com/nodejs/node/pull/35113) +* [[`5c8d2083c5`](https://github.com/nodejs/node/commit/5c8d2083c5)] - **doc**: fix broken link in http2.md (Rich Trott) [#35112](https://github.com/nodejs/node/pull/35112) +* [[`f4e958fc0c`](https://github.com/nodejs/node/commit/f4e958fc0c)] - **doc**: fix broken link in fs.md (Rich Trott) [#35111](https://github.com/nodejs/node/pull/35111) +* [[`79c6d92e49`](https://github.com/nodejs/node/commit/79c6d92e49)] - **doc**: fix broken links in deprecations.md (Rich Trott) [#35109](https://github.com/nodejs/node/pull/35109) +* [[`93e4d545d8`](https://github.com/nodejs/node/commit/93e4d545d8)] - **doc**: add note about path.basename on Windows (Tobias Nießen) [#35065](https://github.com/nodejs/node/pull/35065) +* [[`0a2610a7aa`](https://github.com/nodejs/node/commit/0a2610a7aa)] - **doc**: avoid double-while sentence in perf\_hooks.md (Rich Trott) [#35078](https://github.com/nodejs/node/pull/35078) +* [[`1cf9934e4e`](https://github.com/nodejs/node/commit/1cf9934e4e)] - **doc**: make minor improvements to module.md (Rich Trott) [#35083](https://github.com/nodejs/node/pull/35083) +* [[`fb89be63be`](https://github.com/nodejs/node/commit/fb89be63be)] - **doc**: use correct Error type for EventEmitter.defaultMaxListener (Rich Trott) [#35069](https://github.com/nodejs/node/pull/35069) +* [[`b75822dd93`](https://github.com/nodejs/node/commit/b75822dd93)] - **doc,test**: specify and test CLI option precedence rules (Anna Henningsen) [#35106](https://github.com/nodejs/node/pull/35106) +* [[`4bde865145`](https://github.com/nodejs/node/commit/4bde865145)] - **errors**: simplify ERR\_REQUIRE\_ESM message generation (Rich Trott) [#35123](https://github.com/nodejs/node/pull/35123) +* [[`6e622d6337`](https://github.com/nodejs/node/commit/6e622d6337)] - **esm**: better package.json parser errors (Guy Bedford) [#35117](https://github.com/nodejs/node/pull/35117) +* [[`beb75bd031`](https://github.com/nodejs/node/commit/beb75bd031)] - **fs**: loosen validation to allow objects with an own toString function (Jordan Harband) [#34993](https://github.com/nodejs/node/pull/34993) +* [[`8ea28536d0`](https://github.com/nodejs/node/commit/8ea28536d0)] - **http**: only set keep-alive when not exists (atian25@qq.com) [#35138](https://github.com/nodejs/node/pull/35138) +* [[`977b0ed865`](https://github.com/nodejs/node/commit/977b0ed865)] - **http**: allow Content-Length header for 304 responses (Arnaud Lefebvre) [#34835](https://github.com/nodejs/node/pull/34835) +* [[`d8b57140b4`](https://github.com/nodejs/node/commit/d8b57140b4)] - **https**: set requestTimeout default to 0 (Robert Nagy) [#35264](https://github.com/nodejs/node/pull/35264) +* [[`12f2934224`](https://github.com/nodejs/node/commit/12f2934224)] - **meta**: add links to OpenJSF Slack (Mary Marchini) [#35128](https://github.com/nodejs/node/pull/35128) +* [[`f21a5c6200`](https://github.com/nodejs/node/commit/f21a5c6200)] - **meta**: update my collab entry (devsnek) [#35160](https://github.com/nodejs/node/pull/35160) +* [[`76e24f9aa9`](https://github.com/nodejs/node/commit/76e24f9aa9)] - **module**: use isURLInstance instead of instanceof (Antoine du HAMEL) [#34951](https://github.com/nodejs/node/pull/34951) +* [[`314483cd09`](https://github.com/nodejs/node/commit/314483cd09)] - **module**: fix specifier resolution option value (himself65) [#35098](https://github.com/nodejs/node/pull/35098) +* [[`ca1181615e`](https://github.com/nodejs/node/commit/ca1181615e)] - **(SEMVER-MINOR)** **n-api**: create N-API version 7 (Gabriel Schulhof) [#35199](https://github.com/nodejs/node/pull/35199) +* [[`7f3b2b2a1f`](https://github.com/nodejs/node/commit/7f3b2b2a1f)] - **(SEMVER-MINOR)** **n-api**: add more property defaults (Gerhard Stoebich) [#35214](https://github.com/nodejs/node/pull/35214) +* [[`4f4faa8e3c`](https://github.com/nodejs/node/commit/4f4faa8e3c)] - **readline**: fix key name for function keys with modifiers (DrunkenPoney) [#35268](https://github.com/nodejs/node/pull/35268) +* [[`e29e2daf4c`](https://github.com/nodejs/node/commit/e29e2daf4c)] - **test**: improve assertions in pummel/test-timers (Rich Trott) [#35216](https://github.com/nodejs/node/pull/35216) +* [[`8357b56984`](https://github.com/nodejs/node/commit/8357b56984)] - **test**: add wasi readdir() test (Colin Ihrig) [#35202](https://github.com/nodejs/node/pull/35202) +* [[`49da459ce6`](https://github.com/nodejs/node/commit/49da459ce6)] - **test**: improve pummel/test-timers.js (Rich Trott) [#35175](https://github.com/nodejs/node/pull/35175) +* [[`379c5cefd7`](https://github.com/nodejs/node/commit/379c5cefd7)] - **test**: revise test-policy-integrity (Rich Trott) [#35101](https://github.com/nodejs/node/pull/35101) +* [[`6627c1f8e4`](https://github.com/nodejs/node/commit/6627c1f8e4)] - **test**: remove setMaxListeners in test-crypto-random (Tobias Nießen) [#35079](https://github.com/nodejs/node/pull/35079) +* [[`bc38485fb1`](https://github.com/nodejs/node/commit/bc38485fb1)] - **test**: fix comment about DNS lookup test (Tobias Nießen) [#35080](https://github.com/nodejs/node/pull/35080) +* [[`9faaa659b2`](https://github.com/nodejs/node/commit/9faaa659b2)] - **test**: separate the test fixtures between ICU and URL (Leko) [#35077](https://github.com/nodejs/node/pull/35077) +* [[`25f93f3ec3`](https://github.com/nodejs/node/commit/25f93f3ec3)] - **test**: add more valid results to test-trace-atomics-wait (Anna Henningsen) [#35066](https://github.com/nodejs/node/pull/35066) +* [[`0a97f44b50`](https://github.com/nodejs/node/commit/0a97f44b50)] - **tools**: update ESLint to 7.9.0 (Colin Ihrig) [#35170](https://github.com/nodejs/node/pull/35170) + ## 2020-09-15, Version 14.11.0 (Current), @richardlau diff --git a/src/node_version.h b/src/node_version.h index a1ae35cb8776f4..42b53f309ebf86 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -23,13 +23,13 @@ #define SRC_NODE_VERSION_H_ #define NODE_MAJOR_VERSION 14 -#define NODE_MINOR_VERSION 11 -#define NODE_PATCH_VERSION 1 +#define NODE_MINOR_VERSION 12 +#define NODE_PATCH_VERSION 0 #define NODE_VERSION_IS_LTS 0 #define NODE_VERSION_LTS_CODENAME "" -#define NODE_VERSION_IS_RELEASE 0 +#define NODE_VERSION_IS_RELEASE 1 #ifndef NODE_STRINGIFY #define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)