35170 Commits

Author SHA1 Message Date
Node.js GitHub Bot
26d2f0b4ee
tools: update lint-md-dependencies to @rollup/plugin-node-resolve@13.1.1
PR-URL: https://github.com/nodejs/node/pull/41227
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-12-18 16:57:49 +00:00
Antoine du Hamel
10df3af981 tools: fix CQ and auto-start-ci jobs
PR-URL: https://github.com/nodejs/node/pull/41230
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-12-18 06:07:22 -08:00
Antoine du Hamel
587b167cc4
tools: fix GitHub Actions status when CQ is empty
Refs: https://github.com/nodejs/node/pull/40985#issuecomment-995252065

PR-URL: https://github.com/nodejs/node/pull/41193
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-12-18 01:52:54 +00:00
Danielle Adams
aeb9c0e1ed
2021-12-17, Version 17.3.0 (Current)
OpenSSL-3.0.1:

OpenSSL-3.0.1 contains a fix for CVE-2021-4044: Invalid handling of X509_verify_cert() internal errors
in libssl (Moderate). This is a vulnerability in OpenSSL that may be exploited through Node.js.
More information can be read here: https://www.openssl.org/news/secadv/20211214.txt.

Contributed by Richard Lau https://github.com/nodejs/node/pull/41177

Other Notable Changes:

* lib:
    * make AbortSignal cloneable/transferable (James M Snell) https://github.com/nodejs/node/pull/41050
* deps:
    * upgrade npm to 8.3.0 (npm team) https://github.com/nodejs/node/pull/41127
* doc:
    * add @bnb as a collaborator (Tierney Cyren) https://github.com/nodejs/node/pull/41100
* process:
    * add `getActiveResourcesInfo()` (Darshan Sen) https://github.com/nodejs/node/pull/40813
* timers:
    * add experimental scheduler api (James M Snell) https://github.com/nodejs/node/pull/40909

PR-URL: https://github.com/nodejs/node/pull/41167
2021-12-17 18:13:50 -05:00
mawaregetsuka
e676942f81
doc: adding estimated execution time
PR-URL: https://github.com/nodejs/node/pull/41142
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Stewart X Addison <sxa@redhat.com>
2021-12-17 19:18:21 +00:00
Mateusz Burzyński
e64f432c0d
doc: fix syntax error in nested conditions example
PR-URL: https://github.com/nodejs/node/pull/41205
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Adrian Estrada <edsadr@gmail.com>
2021-12-17 17:35:09 +00:00
Tobias Nießen
80b20b87bd crypto: fix error capture when loading engine
PR-URL: https://github.com/nodejs/node/pull/41187
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2021-12-17 17:53:24 +01:00
Richard Lau
c8f5dd64b1
doc: fix date for v12.22.8
PR-URL: https://github.com/nodejs/node/pull/41213
Refs: https://github.com/nodejs/node/pull/41161
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
2021-12-17 12:04:59 +00:00
Richard Lau
a182a21636
2012-12-16, Version 12.22.8 'Erbium' (LTS)
Notable changes:
This release contains a c-ares update to fix a regression introduced in
Node.js 12.22.5 resolving CNAME records containing underscores
(https://github.com/nodejs/node/issues/39780).

Root certificates have been updated to those from Mozilla's Network
Security Services 3.71 (https://github.com/nodejs/node/pull/40280).

PR-URL: https://github.com/nodejs/node/pull/41161
2021-12-16 18:34:16 -05:00
Rich Trott
9d6168b407
meta: remove community-committee from CODEOWNERS
Files previously managed by TSC + CommComm are now managed by TSC.

PR-URL: https://github.com/nodejs/node/pull/41169
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-12-16 14:00:08 +00:00
Robert Nagy
752d75d8bc stream: add isErrored helper
Refs: https://github.com/nodejs/undici/pull/1134

PR-URL: https://github.com/nodejs/node/pull/41121
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2021-12-16 14:28:31 +01:00
Richard Lau
a3195f20cd deps: update archs files for quictls/openssl-3.0.1+quic
After an OpenSSL source update, all the config files need to be
regenerated and committed by:
    $ make -C deps/openssl/config
    $ git add deps/openssl/config/archs
    $ git add deps/openssl/openssl
    $ git commit

PR-URL: https://github.com/nodejs/node/pull/41177
Refs: https://github.com/quictls/openssl/pull/69
Refs: https://mta.openssl.org/pipermail/openssl-announce/2021-December/000212.html
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
2021-12-16 11:51:19 +00:00
Richard Lau
44804a9cf7 deps: upgrade openssl sources to quictls/openssl-3.0.1+quic
This updates all sources in deps/openssl/openssl by:
    $ git clone git@github.com:quictls/openssl.git
    $ cd openssl
    $ cd ../node/deps/openssl
    $ rm -rf openssl
    $ cp -R ../openssl openssl
    $ rm -rf openssl/.git* openssl/.travis*
    $ git add --all openssl
    $ git commit openssl

PR-URL: https://github.com/nodejs/node/pull/41177
Refs: https://github.com/quictls/openssl/pull/69
Refs: https://mta.openssl.org/pipermail/openssl-announce/2021-December/000212.html
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
2021-12-16 11:51:18 +00:00
Richard Lau
4b5b9a8f15 test: do not load absolute path crypto engines twice
Newer versions of OpenSSL now throws an error if an engine is loaded
twice by its absolute path (a second load by its id appears to be okay).

PR-URL: https://github.com/nodejs/node/pull/41177
Refs: https://github.com/quictls/openssl/pull/69
Refs: https://mta.openssl.org/pipermail/openssl-announce/2021-December/000212.html
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
2021-12-16 11:51:17 +00:00
Richard Lau
6f61c2b41f build: update openssl config generator Dockerfile
The `deps/openssl/config/generate_headers.pl` imports `Text::Template`
but that Perl module is not present in the default Perl installation in
the Dockerfile and needs to be explicitly installed.

PR-URL: https://github.com/nodejs/node/pull/41177
Refs: https://github.com/quictls/openssl/pull/69
Refs: https://mta.openssl.org/pipermail/openssl-announce/2021-December/000212.html
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
2021-12-16 11:51:16 +00:00
AlphaDio
7f6243efd5
doc: fix closing parenthesis
PR-URL: https://github.com/nodejs/node/pull/41190
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2021-12-16 06:52:52 +00:00
Cheng Zhao
e56bf500c7
build: use '<(python)' instead of 'python'
PR-URL: https://github.com/nodejs/node/pull/41146
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2021-12-16 02:10:14 +00:00
Michael Dawson
13ee108dd9 doc: add security steward on/offboarding steps
Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/41129
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-12-15 19:00:23 -05:00
Node.js GitHub Bot
162e5a1353 meta: move one or more collaborators to emeritus
PR-URL: https://github.com/nodejs/node/pull/41154
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2021-12-15 14:10:32 -08:00
Rich Trott
41e1de6f40 build,tools: automate enforcement of emeritus criteria
PR-URL: https://github.com/nodejs/node/pull/41155
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Stewart X Addison <sxa@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Gus Caplan <me@gus.host>
2021-12-15 21:38:35 +00:00
Rich Trott
6749e3fb1c meta: move to emeritus automatically after 18 months
Similar to the rules for automatic removal from active TSC membership,
provide criteria for automatic assignment to emeritus status for
inactive collaborators.

PR-URL: https://github.com/nodejs/node/pull/41155
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Stewart X Addison <sxa@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Gus Caplan <me@gus.host>
2021-12-15 21:38:34 +00:00
Mestery
6267e55685
build: fix comment-labeled workflow
Refs: https://github.com/nodejs/node/pull/40985#issuecomment-994056146

PR-URL: https://github.com/nodejs/node/pull/41176
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-12-14 23:09:12 +00:00
silverwind
3852ed9627 meta: move silverwind to emeriti
PR-URL: https://github.com/nodejs/node/pull/41171
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-12-14 11:21:54 -08:00
Mestery
f404cd5ce2
build: use gh cli in workflows file
PR-URL: https://github.com/nodejs/node/pull/40985
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-12-14 19:06:36 +00:00
Qingyu Deng
ea977fca14
doc: align module resolve algorithm with implementation
Fixes: https://github.com/nodejs/node/issues/38128

PR-URL: https://github.com/nodejs/node/pull/38837
Reviewed-By: Guy Bedford <guybedford@gmail.com>
2021-12-14 19:51:24 +01:00
Darshan Sen
ced5fc3930
assert: prefer reference comparison over string comparison
Pointer comparison takes constant time and string comparison takes
linear time unless there is some string interning going on, so this
might be a little bit faster.

Signed-off-by: Darshan Sen <darshan.sen@postman.com>

PR-URL: https://github.com/nodejs/node/pull/41015
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-12-14 14:58:47 +00:00
Darshan Sen
0d9f3bd9e8
process: add getActiveResourcesInfo()
This is supposed to be a public alternative of the private APIs,
`process._getActiveResources()` and `process._getActiveHandles()`. When
called, it returns an array of strings containing the types of the
active resources that are currently keeping the event loop alive.

Signed-off-by: Darshan Sen <darshan.sen@postman.com>

PR-URL: https://github.com/nodejs/node/pull/40813
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-12-14 14:09:08 +00:00
Gabriel Bota
85d4cd3079
loader: return package format from defaultResolve if known
This is a proposed modification of defaultResolve to return the package
format in case it has been found during package resolution.
The format will be returned as described in the documentation:
https://nodejs.org/api/esm.html#resolvespecifier-context-defaultresolve
There is one new unit test as well:
test/es-module/test-esm-resolve-type.js

PR-URL: https://github.com/nodejs/node/pull/40980
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-12-13 20:44:00 +00:00
Antoine du Hamel
e5c1fd7a2a
fs: accept URL as argument for fs.rm and fs.rmSync
PR-URL: https://github.com/nodejs/node/pull/41132
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-12-13 14:45:09 +00:00
Node.js GitHub Bot
bc6072e28b
tools: update doc to remark-rehype@10.1.0
PR-URL: https://github.com/nodejs/node/pull/41149
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-12-13 14:29:24 +01:00
Node.js GitHub Bot
ad91abcbad tools: update lint-md-dependencies to rollup@2.61.1 vfile-reporter@7.0.3
PR-URL: https://github.com/nodejs/node/pull/41150
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-12-12 18:43:52 -08:00
Node.js GitHub Bot
4d7dd6c38a meta: update AUTHORS
PR-URL: https://github.com/nodejs/node/pull/41144
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-12-12 15:49:09 -08:00
npm team
0f5aedb4a8 deps: upgrade npm to 8.3.0
PR-URL: https://github.com/nodejs/node/pull/41127
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-12-12 20:46:54 +01:00
Michael Dawson
e46446dceb
doc: update nodejs-sec managers
I'll submit a follow on PR to better document security
stewards along with their onboarding. For now just fix
the list so it's not out of date.

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/41128
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-12-12 19:40:46 +00:00
Rich Trott
12e3c74e2e tools: enable jsdoc/require-returns-type ESLint rule
PR-URL: https://github.com/nodejs/node/pull/41130
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2021-12-12 03:51:01 +00:00
Rich Trott
88dd9724b0 lib: include return types in JSDoc
Add types to @returns JSDoc annotations where the type is missing.

PR-URL: https://github.com/nodejs/node/pull/41130
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2021-12-12 03:51:00 +00:00
Ruben Bridgewater
c2ff69db4c util: serialize falsy cause values while inspecting errors
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>

PR-URL: https://github.com/nodejs/node/pull/41097
Fixes: https://github.com/nodejs/node/issues/41096
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2021-12-11 12:05:41 +00:00
Ruben Bridgewater
1133796dbf util: make sure error causes of any type may be inspected
An error cause may be of any type. Handle all of them, no matter
if they are an error or not.

Fixes: https://github.com/nodejs/node/issues/41096

Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>

PR-URL: https://github.com/nodejs/node/pull/41097
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2021-12-11 12:05:41 +00:00
Ruben Bridgewater
4569674e39
util: pass through the inspect function to custom inspect functions
This allows to use more portable custom inspect functions.

Fixes: https://github.com/nodejs/node/issues/35956

Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>

PR-URL: https://github.com/nodejs/node/pull/41019
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2021-12-11 11:49:45 +00:00
Rich Trott
73fe15bf24
build: fix commit-queue-rebase functionality
For commit-queue-rebase only, commit-queue.sh uses `git push` which
requires the credentials from the git checkout. Remove
`persist-credentials: false` from this workflow.

PR-URL: https://github.com/nodejs/node/pull/41140
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2021-12-11 11:00:00 +00:00
Rich Trott
42dd3ca869
doc: move style guide to findable location
Move the style guide to doc/README.md so people might find it. The
current location is easily overlooked, as is evidenced by
https://github.com/nodejs/node/pull/41025

PR-URL: https://github.com/nodejs/node/pull/41119
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-12-11 04:26:27 +00:00
James M Snell
29a909ab22 lib: make AbortSignal cloneable/transferable
Allows for using `AbortSignal` across worker threads and contexts.

```js
const ac = new AbortController();
const mc = new MessageChannel();
mc.port1.onmessage = ({ data }) => {
  data.addEventListener('abort', () => {
    console.log('aborted!');
  });
};
mc.port2.postMessage(ac.signal, [ac.signal]);
```

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/41050
Refs: https://github.com/whatwg/dom/issues/948
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2021-12-10 19:22:05 -08:00
Irakli Gozalishvili
2e1fa8ab28
buffer: fix Blob constructor on various TypedArrays
Fixes: https://github.com/nodejs/node/issues/40705
    
PR-URL: https://github.com/nodejs/node/pull/40706
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-12-11 00:36:20 +01:00
Michael Dawson
98ec909f2b
src: fix limit calculation
Coverity reported that the use of sizeof along with pointer
arithmetic was likely an error as the pointer arithmetic
would already be accounting for the size of what the
pointer points to.

Looking at the code that looked right but removing the
extra sizeOf caused tests to fail.

Looking more closely it seems like we were not allocating
a big enough buffer but the extra sizeof was allowing
us to convert even though it might have been corrupting
memory.

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/41026
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-12-10 23:30:08 +00:00
Santiago Gimeno
ef7a686ed9
http: don't write empty data on req/res end()
When calling OutgoingMessage.end() with empty data argument, avoid
writing to the socket unless there's still pending data to be sent.

Fixes: https://github.com/nodejs/node/issues/41062

PR-URL: https://github.com/nodejs/node/pull/41116
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-12-10 19:44:24 +00:00
Michael Dawson
f32649a382 inspector: add missing initialization
Add missing initialization flagged by Coverity

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/41022
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-12-10 14:06:23 -05:00
jakub-g
12605000ae
doc: fix comments in test-fs-watch.js
PR-URL: https://github.com/nodejs/node/pull/41046
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-12-10 17:27:54 +00:00
James M Snell
3f72c72bbb
lib: add abortSignal.throwIfAborted()
Refs: https://github.com/whatwg/dom/pull/1034
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/40951
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-12-10 07:51:41 -08:00
Rich Trott
03c9837457
tools: update ESLint to 8.4.1
PR-URL: https://github.com/nodejs/node/pull/41114
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2021-12-10 10:26:57 +00:00
Antoine du Hamel
2f602258e0
fs: fix error codes for fs.cp
The context passed into this error must have `.code`, `.syscall` and
`.message`.

Fixes: https://github.com/nodejs/node/issues/41104

PR-URL: https://github.com/nodejs/node/pull/41106
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-12-10 10:26:47 +00:00