Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2022-04-28src,crypto: remove uses of AllocatedBuffer from crypto_ec.ccDarshan Sen
Refs: https://github.com/nodejs/node/pull/39941 Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: https://github.com/nodejs/node/pull/42766 Reviewed-By: James M Snell <jasnell@gmail.com>
2022-04-28v8: export more fields in getHeapStatisticstheanarkh
export total_global_handles_size, used_global_handles_size, external_memory in getHeapStatistics PR-URL: https://github.com/nodejs/node/pull/42784 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2022-04-28lib,src: implement WebAssembly Web APITobias Nießen
Refs: https://github.com/nodejs/node/pull/41749 Fixes: https://github.com/nodejs/node/issues/21130 PR-URL: https://github.com/nodejs/node/pull/42701 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-04-28src: define fs.constants.S_IWUSR & S_IRUSR for WinLiviu Ionescu
On Windows, most of the POSIX file mode definitions are not available. However, functionally equivalent read/write definitions exists, and chmod() can use them. This patch defines two aliases, so that these definintions are issued in fs.constants. fixes: https://github.com/nodejs/node/issues/41591 PR-URL: https://github.com/nodejs/node/pull/42757 Refs: https://github.com/nodejs/node/issues/41591 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2022-04-28src: use `node:` prefix in exampleAntoine du Hamel
Refs: https://github.com/nodejs/node/pull/42752 PR-URL: https://github.com/nodejs/node/pull/42794 Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-04-28doc: add `node:` prefix for all core modulesAntoine du Hamel
Some core modules can be loaded with or without the `node:` prefix. Using the prefix disambiguates which specifiers refer to core modules. This commit updates the docs to use the prefix everywhere a core module is referenced. PR-URL: https://github.com/nodejs/node/pull/42752 Fixes: https://github.com/nodejs/node/issues/38343 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2022-04-28worker: add hasRef() to the handle objectDarshan Sen
This should help projects like https://github.com/mafintosh/why-is-node-running and https://github.com/facebook/jest to detect if Worker instances are keeping the event loop active correctly. Fixes: https://github.com/nodejs/node/issues/42091 Refs: https://github.com/mafintosh/why-is-node-running/issues/59 Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: https://github.com/nodejs/node/pull/42756 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-04-28doc: consolidate use of multiple-byte unitsAntoine du Hamel
Refs: https://en.wikipedia.org/wiki/Byte#Multiple-byte_units PR-URL: https://github.com/nodejs/node/pull/42587 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com>
2022-04-28bootstrap: use the isolate snapshot in workersJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/42702 Refs: https://github.com/nodejs/node/issues/35711 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
2022-04-28bootstrap: move embedded snapshot to SnapshotBuilderJoyee Cheung
So that the embedded snapshot can be reused by the worker. PR-URL: https://github.com/nodejs/node/pull/42702 Refs: https://github.com/nodejs/node/issues/35711 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
2022-04-28async_hooks: avoid decrementing iterator after eraseGabriel Bota
decrementing an iterator returned by `std::vector::erase` may have undefined behaviour and should not be used. Decrementing `end()` on an empty container is undefined and `.erase()` could leave the container empty. Instead, by calling `vec.erase(it--)` we decrement the valid iterator before the erase operation but after being passed to the erase method. In case of `AsyncHooks::RemoveContext` perform the cleanup of empty contexts upfront using `std::remove_if` because the iteration gets interrupted as soon as the context to be removed has been found. PR-URL: https://github.com/nodejs/node/pull/42749 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-04-28src: large page attributing an id on LinuxDavid CARLIER
Using the new PR_SET_VMA_ANON_NAME prctl attribute available since the 5.17 release, when rolling out the process address map appears as ` <start>-<end> r-xp 00000000 00:00 0 [anon:nodejs Large Page] ` PR-URL: https://github.com/nodejs/node/pull/42644 Reviewed-By: James M Snell <jasnell@gmail.com>
2022-04-28test_runner: add initial CLI runnerColin Ihrig
This commit introduces an initial version of a CLI-based test runner. PR-URL: https://github.com/nodejs/node/pull/42658 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-04-19Working on v18.0.1Beth Griggs
PR-URL: https://github.com/nodejs/node/pull/42262
2022-04-182022-04-19, Version 18.0.0 (Current)v18.0.0Beth Griggs
Notable Changes: Deprecations and Removals: - (SEMVER-MAJOR) fs: runtime deprecate string coercion in `fs.write`, `fs.writeFileSync` (Livia Medeiros) (https://github.com/nodejs/node/pull/42607) - (SEMVER-MAJOR) dns: remove `dns.lookup` and `dnsPromises.lookup` options type coercion (Antoine du Hamel) (https://github.com/nodejs/node/pull/41431) - (SEMVER-MAJOR) process: runtime deprecate multipleResolves (Benjamin Gruenbaum) (https://github.com/nodejs/node/pull/41896) - (SEMVER-MAJOR) stream: remove thenable support (Robert Nagy) (https://github.com/nodejs/node/pull/40773) - (SEMVER-MAJOR) tls: move tls.parseCertString to end-of-life (Tobias Nießen) (https://github.com/nodejs/node/pull/41479) fetch (experimental): An experimental fetch API is available on the global scope by default. The implementation is based upon https://undici.nodejs.org/#/, an HTTP/1.1 client written for Node.js by contributors to the project. Through this addition, the following globals are made available: `fetch` , `FormData`, `Headers`, `Request`, `Response`. Disable this API with the `--no-experimental-fetch` command-line flag. Contributed by Michaël Zasso in https://github.com/nodejs/node/pull/41811. HTTP Timeouts: `server.headersTimeout`, which limits the amount of time the parser will wait to receive the complete HTTP headers, is now set to `60000` (60 seconds) by default. `server.requestTimeout`, which sets the timeout value in milliseconds for receiving the entire request from the client, is now set to `300000` (5 minutes) by default. If these timeouts expire, the server responds with status 408 without forwarding the request to the request listener and then closes the connection. Both timeouts must be set to a non-zero value to protect against potential Denial-of-Service attacks in case the server is deployed without a reverse proxy in front. Contributed by Paolo Insogna in https://github.com/nodejs/node/pull/41263. Test Runner module (experimental): The `node:test` module facilitates the creation of JavaScript tests that report results in TAP format. This module is only available under the `node:` scheme. Contributed by Colin Ihrig in https://github.com/nodejs/node/pull/42325. Toolchain and Compiler Upgrades: - Prebuilt binaries for Linux are now built on Red Hat Enterprise Linux (RHEL) 8 and are compatible with Linux distributions based on glibc 2.28 or later, for example, Debian 10, RHEL 8, Ubuntu 20.04. - Prebuilt binaries for macOS now require macOS 10.15 or later. - For AIX the minimum supported architecture has been raised from Power 7 to Power 8. Prebuilt binaries for 32-bit Windows will initially not be available due to issues building the V8 dependency in Node.js. We hope to restore 32-bit Windows binaries for Node.js 18 with a future V8 update. Node.js does not support running on operating systems that are no longer supported by their vendor. For operating systems where their vendor has planned to end support earlier than April 2025, such as Windows 8.1 (January 2023) and Windows Server 2012 R2 (October 2023), support for Node.js 18 will end at the earlier date. Full details about the supported toolchains and compilers are documented in the Node.js `BUILDING.md` file. Contributed by Richard Lau in https://github.com/nodejs/node/pull/42292, https://github.com/nodejs/node/pull/42604 and https://github.com/nodejs/node/pull/42659 , and Michaël Zasso in https://github.com/nodejs/node/pull/42105 and https://github.com/nodejs/node/pull/42666. V8 10.1: The V8 engine is updated to version 10.1, which is part of Chromium 101. Compared to the version included in Node.js 17.9.0, the following new features are included: - The `findLast` and `findLastIndex` array methods. - Improvements to the `Intl.Locale` API. - The `Intl.supportedValuesOf` function. - Improved performance of class fields and private class methods (the initialization of them is now as fast as ordinary property stores). The data format returned by the serialization API (`v8.serialize(value)`) has changed, and cannot be deserialized by earlier versions of Node.js. On the other hand, it is still possible to deserialize the previous format, as the API is backwards-compatible. Contributed by Michaël Zasso in https://github.com/nodejs/node/pull/42657. Web Streams API (experimental): Node.js now exposes the experimental implementation of the Web Streams API on the global scope. This means the following APIs are now globally available: - `ReadableStream`, `ReadableStreamDefaultReader`, `ReadableStreamBYOBReader`, `ReadableStreamBYOBRequest`, `ReadableByteStreamController`, `ReadableStreamDefaultController`, `TransformStream`, `TransformStreamDefaultController`, `WritableStream`, `WritableStreamDefaultWriter`, `WritableStreamDefaultController`, `ByteLengthQueuingStrategy`, `CountQueuingStrategy`, `TextEncoderStream`, `TextDecoderStream`, `CompressionStream`, `DecompressionStream`. Contributed James Snell in https://github.com/nodejs/node/pull/39062, and Antoine du Hamel in https://github.com/nodejs/node/pull/42225. Other Notable Changes: - (SEMVER-MAJOR) buffer: expose Blob as a global (James M Snell) (https://github.com/nodejs/node/pull/41270) - (SEMVER-MAJOR) child\_process: improve argument validation (Rich Trott) (https://github.com/nodejs/node/pull/41305) - doc: add RafaelGSS to collaborators (RafaelGSS) (https://github.com/nodejs/node/pull/42718) - (SEMVER-MAJOR) http: make TCP noDelay enabled by default (Paolo Insogna) (https://github.com/nodejs/node/pull/42163) - (SEMVER-MAJOR) net: make `server.address()` return an integer for `family` (Antoine du Hamel) (https://github.com/nodejs/node/pull/41431) - (SEMVER-MAJOR) worker: expose BroadcastChannel as a global (James M Snell) (https://github.com/nodejs/node/pull/41271) - (SEMVER-MAJOR) worker: graduate BroadcastChannel to supported (James M Snell) (https://github.com/nodejs/node/pull/41271) Semver-Major Commits: - (SEMVER-MAJOR) assert,util: compare RegExp.lastIndex while using deep equal checks (Ruben Bridgewater) (https://github.com/nodejs/node/pull/41020) - (SEMVER-MAJOR) buffer: refactor `byteLength` to remove outdated optimizations (Rongjian Zhang) (https://github.com/nodejs/node/pull/38545) - (SEMVER-MAJOR) buffer: expose Blob as a global (James M Snell) (https://github.com/nodejs/node/pull/41270) - (SEMVER-MAJOR) buffer: graduate Blob from experimental (James M Snell) (https://github.com/nodejs/node/pull/41270) - (SEMVER-MAJOR) build: make x86 Windows support temporarily experimental (Michaël Zasso) (https://github.com/nodejs/node/pull/42666) - (SEMVER-MAJOR) build: bump macOS deployment target to 10.15 (Richard Lau) (https://github.com/nodejs/node/pull/42292) - (SEMVER-MAJOR) build: downgrade Windows 8.1 and server 2012 R2 to experimental (Michaël Zasso) (https://github.com/nodejs/node/pull/42105) - (SEMVER-MAJOR) child\_process: improve argument validation (Rich Trott) (https://github.com/nodejs/node/pull/41305) - (SEMVER-MAJOR) cluster: make `kill` to be just `process.kill` (Bar Admoni) (https://github.com/nodejs/node/pull/34312) - (SEMVER-MAJOR) crypto: cleanup validation (Mohammed Keyvanzadeh) (https://github.com/nodejs/node/pull/39841) - (SEMVER-MAJOR) crypto: prettify othername in PrintGeneralName (Tobias Nießen) (https://github.com/nodejs/node/pull/42123) - (SEMVER-MAJOR) crypto: fix X509Certificate toLegacyObject (Tobias Nießen) (https://github.com/nodejs/node/pull/42124) - (SEMVER-MAJOR) crypto: use RFC2253 format in PrintGeneralName (Tobias Nießen) (https://github.com/nodejs/node/pull/42002) - (SEMVER-MAJOR) crypto: change default check(Host|Email) behavior (Tobias Nießen) (https://github.com/nodejs/node/pull/41600) - (SEMVER-MAJOR) deps: V8: cherry-pick semver-major commits from 10.2 (Michaël Zasso) (https://github.com/nodejs/node/pull/42657) - (SEMVER-MAJOR) deps: update V8 to 10.1.124.6 (Michaël Zasso) (https://github.com/nodejs/node/pull/42657) - (SEMVER-MAJOR) deps: update V8 to 9.8.177.9 (Michaël Zasso) (https://github.com/nodejs/node/pull/41610) - (SEMVER-MAJOR) deps: update V8 to 9.7.106.18 (Michaël Zasso) (https://github.com/nodejs/node/pull/40907) - (SEMVER-MAJOR) dns: remove `dns.lookup` and `dnsPromises.lookup` options type coercion (Antoine du Hamel) (https://github.com/nodejs/node/pull/41431) - (SEMVER-MAJOR) doc: update minimum glibc requirements for Linux (Richard Lau) (https://github.com/nodejs/node/pull/42659) - (SEMVER-MAJOR) doc: update AIX minimum supported arch (Richard Lau) (https://github.com/nodejs/node/pull/42604) - (SEMVER-MAJOR) fs: runtime deprecate string coercion in `fs.write`, `fs.writeFileSync` (Livia Medeiros) (https://github.com/nodejs/node/pull/42607) - (SEMVER-MAJOR) http: refactor headersTimeout and requestTimeout logic (Paolo Insogna) (https://github.com/nodejs/node/pull/41263) - (SEMVER-MAJOR) http: make TCP noDelay enabled by default (Paolo Insogna) (https://github.com/nodejs/node/pull/42163) - (SEMVER-MAJOR) lib: enable fetch by default (Michaël Zasso) (https://github.com/nodejs/node/pull/41811) - (SEMVER-MAJOR) lib: replace validator and error (Mohammed Keyvanzadeh) (https://github.com/nodejs/node/pull/41678) - (SEMVER-MAJOR) module,repl: support 'node:'-only core modules (Colin Ihrig) (https://github.com/nodejs/node/pull/42325) - (SEMVER-MAJOR) net: make `server.address()` return an integer for `family` (Antoine du Hamel) (https://github.com/nodejs/node/pull/41431) - (SEMVER-MAJOR) process: disallow some uses of Object.defineProperty() on process.env (Himself65) (https://github.com/nodejs/node/pull/28006) - (SEMVER-MAJOR) process: runtime deprecate multipleResolves (Benjamin Gruenbaum) (https://github.com/nodejs/node/pull/41896) - (SEMVER-MAJOR) readline: fix question still called after closed (Xuguang Mei) (https://github.com/nodejs/node/pull/42464) - (SEMVER-MAJOR) stream: remove thenable support (Robert Nagy) (https://github.com/nodejs/node/pull/40773) - (SEMVER-MAJOR) stream: expose web streams globals, remove runtime experimental warning (Antoine du Hamel) (https://github.com/nodejs/node/pull/42225) - (SEMVER-MAJOR) stream: need to cleanup event listeners if last stream is readable (Xuguang Mei) (https://github.com/nodejs/node/pull/41954) - (SEMVER-MAJOR) stream: revert revert `map` spec compliance (Benjamin Gruenbaum) (https://github.com/nodejs/node/pull/41933) - (SEMVER-MAJOR) stream: throw invalid arg type from End Of Stream (Jithil P Ponnan) (https://github.com/nodejs/node/pull/41766) - (SEMVER-MAJOR) stream: don't emit finish after destroy (Robert Nagy) (https://github.com/nodejs/node/pull/40852) - (SEMVER-MAJOR) stream: add errored and closed props (Robert Nagy) (https://github.com/nodejs/node/pull/40696) - (SEMVER-MAJOR) test: add initial test module (Colin Ihrig) (https://github.com/nodejs/node/pull/42325) - (SEMVER-MAJOR) timers: refactor internal classes to ES2015 syntax (Rabbit) (https://github.com/nodejs/node/pull/37408) - (SEMVER-MAJOR) tls: represent registeredID numerically always (Tobias Nießen) (https://github.com/nodejs/node/pull/41561) - (SEMVER-MAJOR) tls: move tls.parseCertString to end-of-life (Tobias Nießen) (https://github.com/nodejs/node/pull/41479) - (SEMVER-MAJOR) url: throw on NULL in IPv6 hostname (Rich Trott) (https://github.com/nodejs/node/pull/42313) - (SEMVER-MAJOR) v8: make v8.writeHeapSnapshot() error codes consistent (Darshan Sen) (https://github.com/nodejs/node/pull/42577) - (SEMVER-MAJOR) v8: make writeHeapSnapshot throw if fopen fails (Antonio Román) (https://github.com/nodejs/node/pull/41373) - (SEMVER-MAJOR) worker: expose BroadcastChannel as a global (James M Snell) (https://github.com/nodejs/node/pull/41271) - (SEMVER-MAJOR) worker: graduate BroadcastChannel to supported (James M Snell) (https://github.com/nodejs/node/pull/41271) PR-URL: https://github.com/nodejs/node/pull/42262
2022-04-13src: fix coverity reportMichael Dawson
Fix coverity report about possibly dereferencing a null. If the the buffer.data != nullptr check indicates that the buffer was null, then relying on the value in buffer_size is no longer safe. The later call to uv_pipe_getpeername depends on the buffer_size being correct to avoid deferencing buffer.data if it is not big enough. Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: https://github.com/nodejs/node/pull/42663 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2022-04-13http: refactor headersTimeout and requestTimeout logicPaolo Insogna
PR-URL: https://github.com/nodejs/node/pull/41263 Fixes: https://github.com/nodejs/node/issues/33440 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-04-12src: update NODE_MODULE_VERSION to 108Michaël Zasso
Major V8 updates are usually API/ABI incompatible with previous versions. This commit adapts NODE_MODULE_VERSION for V8 10.1. Refs: https://github.com/nodejs/CTC/blob/master/meetings/2016-09-28.md PR-URL: https://github.com/nodejs/node/pull/42657 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
2022-04-12net: make `server.address()` return an integer for `family`Antoine du Hamel
`dns.lookup` options only accepts integer for `family` options, having a string doesn't really make sense here. PR-URL: https://github.com/nodejs/node/pull/41431 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-04-11src: fix alphabetically sorted binding listTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/42687 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
2022-04-11src,crypto: remove uses of AllocatedBuffer from crypto_tls.ccDarshan Sen
Refs: https://github.com/nodejs/node/pull/39941 Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: https://github.com/nodejs/node/pull/42589 Reviewed-By: James M Snell <jasnell@gmail.com>
2022-04-09src,inspector: fix empty MaybeLocal crashDarshan Sen
Return early when the Inspector StringView to V8 String conversion fails and returns an empty MaybeLocal instead of running the invalid ToLocalChecked() assertion. Fixes: https://github.com/nodejs/node/issues/42407 Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: https://github.com/nodejs/node/pull/42409 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2022-04-07node-api,src: fix module registration in MSVC C++Vladimir Morozov
PR-URL: https://github.com/nodejs/node/pull/42459 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2022-04-05v8: make v8.writeHeapSnapshot() error codes consistentDarshan Sen
This change makes the error codes returned by v8.writeHeapSnapshot() consistent across all platforms by using the libuv APIs instead of fopen(), fwrite() and fclose(). This also starts reporting potential errors that might happen during the write operations. Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: https://github.com/nodejs/node/pull/42577 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2022-04-04test_runner: support 'only' testsColin Ihrig
This commit introduces a CLI flag and test runner functionality to support running a subset of tests that are indicated by an 'only' option passed to the test. PR-URL: https://github.com/nodejs/node/pull/42514 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-04-04process: disallow some uses of Object.defineProperty() on process.envHimself65
Disallow the use of Object.defineProperty() to hide entries in process.env or make them immutable. PR-URL: https://github.com/nodejs/node/pull/28006 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-04-03src: add proper mutexes for accessing FIPS stateAnna Henningsen
The FIPS state handling and OpenSSL initialization code makes accesses to global OpenSSL state without any protection against parallel modifications from multiple threads. This commit adds such protections. PR-URL: https://github.com/nodejs/node/pull/42278 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-04-01src: fix typo in InspectorIoDelegate constructorKohei Ueno
PR-URL: https://github.com/nodejs/node/pull/42520 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com> Reviewed-By: Tierney Cyren <hello@bnb.im>
2022-03-31bootstrap: run inspector and event loop in snapshot builderJoyee Cheung
This makes --inspect and stdin/out functional in the embedded snapshot, currently it's not guaranteed that these work perfectly, the plan is to investigate any out-of-sync states that might appear in user land snapshots with this while the it is a configure-time feature. PR-URL: https://github.com/nodejs/node/pull/42466 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2022-03-31build: add --node-snapshot-main configure optionJoyee Cheung
This adds a --build-snapshot runtime option which is currently only supported by the node_mksnapshot binary, and a --node-snapshot-main configure option that makes use it to run a custom script when building the embedded snapshot. The idea is to have this experimental feature in core as a configure-time feature for now, and investigate the renaming V8 bugs before we make it available to more users via making it a runtime option. PR-URL: https://github.com/nodejs/node/pull/42466 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2022-03-31src,crypto: handle empty maybe correctly in crypto_dh.ccDarshan Sen
Buffer::Length() dereferences the passed Local, so calling it when the underlying pointer is a nullptr would lead to a crash. This fixes that by returning early instead. Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: https://github.com/nodejs/node/pull/42492 Refs: https://github.com/nodejs/node/pull/39941 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2022-03-31src: remove unnecessary static qualifier in crypto_dh.ccDarshan Sen
ZeroPadDiffieHellmanSecret() is in an anonymous namespace, so it has static linkage already. Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: https://github.com/nodejs/node/pull/42492 Refs: https://github.com/nodejs/node/pull/39941 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2022-03-31src,crypto: remove uses of AllocatedBuffer from crypto_dh.ccDarshan Sen
Refs: https://github.com/nodejs/node/pull/39941 Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: https://github.com/nodejs/node/pull/42492 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2022-03-29src: address 3 useless call coverity warningsMichael Dawson
Fix the last 3 useless call reports from coverity Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: https://github.com/nodejs/node/pull/42426 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2022-03-29net,dns: trace tcp connection and dns by perf_hookstheanarkh
use the perf_hooks to trace the time spent by net.connect, dns.lookup, dns.lookupService, dns.resolvexxx. PR-URL: https://github.com/nodejs/node/pull/42390 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2022-03-27crypto: make authTagLength optional for CC20P1305Tobias Nießen
PR-URL: https://github.com/nodejs/node/pull/42427 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2022-03-26src: properly report exceptions from AddressToJS()Darshan Sen
Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: https://github.com/nodejs/node/pull/42054 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-03-23bootstrap: use SnapshotData to pass snapshot data aroundJoyee Cheung
Instead of passing the snapshot blob, the per-isolate data indices and the EnvSerializeInfo separately, use the aggregate type Snapshot to carry these around, and refactor NodeMainInstance so that it owns the v8::Isolate::CreateParams when it owns its isolate. This also gets rid of the owns_isolate_ and deserialize_mode_ booleans in NodeMainInstance since NodeMainInstance can compute these by just checking if it has pointers to the CreateParams or the SnapshotData. PR-URL: https://github.com/nodejs/node/pull/42360 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-03-23src: suppress false coverity warningMichael Dawson
Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: https://github.com/nodejs/node/pull/42284 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2022-03-21async_hooks: remove destroyed symbol on PromisesGerhard Stöbich
Promises are never destroyed manually therefore it's not needed to attach an object to track if destroy hook was called already. PR-URL: https://github.com/nodejs/node/pull/42402 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2022-03-21node-api: format Node-API related codeVladimir Morozov
PR-URL: https://github.com/nodejs/node/pull/42396 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-03-21src: refactor IsSupportedAuthenticatedModeTobias Nießen
Improve the function's structure and clarify the special handling of ChaCha20-Poly1305. Remove the IS_OCB_MODE macro. PR-URL: https://github.com/nodejs/node/pull/42368 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-03-20crypto: fix auth tag length error when mode != GCMTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/42383 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2022-03-18src: convert hex2bin() into a regular functionDarshan Sen
No need to write hex2bin() as a function template because it's only called with a char parameter. Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: https://github.com/nodejs/node/pull/42321 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2022-03-18worker: do not send message if port is closingRich Trott
Fixes: https://github.com/nodejs/node/issues/42296 PR-URL: https://github.com/nodejs/node/pull/42357 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2022-03-15src: fix coverity warnings in node_file.ccMichael Dawson
Fix two warnings about a useless call and not checking a return value. Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: https://github.com/nodejs/node/pull/42272 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-03-14src: check EC_POINT_get_affine_coordinates resultTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/42304 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-03-14src: simplify bound check in ParseArrayIndexTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/42306 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2022-03-14src: avoid returning invalid value from hex2binTobias Nießen
If the input is not a valid hexadecimal digit, hex2bin should not return an invalid value, which is not handled correctly by the caller, which is the PercentDecode function. However, PercentDecode only ever calls the hex2bin function with valid hexadecimal digits, so mark the code path that previously returned an invalid value for non-digits as UNREACHABLE. PR-URL: https://github.com/nodejs/node/pull/42307 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2022-03-14src: check return value of HMAC_FinalTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/42303 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>