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-05-07build: fix various shared library build issuesWilliam Marlow
Node.js unofficially supports a shared library variant where the main node executable is a thin wrapper around node.dll/libnode.so. The key benefit of this is to support embedding Node.js in other applications. Since Node.js 12 there have been a number of issues preventing the shared library build from working correctly, primarily on Windows: * A number of functions used executables such as `mksnapshot` are not exported from `libnode.dll` using a `NODE_EXTERN` attribute * A dependency on the `Winmm` system library is missing * Incorrect defines on executable targets leads to `node.exe` claiming to export a number of functions that are actually in `libnode.dll` * Because `node.exe` attempts to export symbols, `node.lib` gets generated causing native extensions to try to link against `node.exe` not `libnode.dll`. * Similarly, because `node.dll` was renamed to `libnode.dll`, native extensions don't know to look for `libnode.lib` rather than `node.lib`. * On macOS an RPATH is added to find `libnode.dylib` relative to `node` in the same folder. This works fine from the `out/Release` folder but not from an installed prefix, where `node` will be in `bin/` and `libnode.dylib` will be in `lib/`. * Similarly on Linux, no RPATH is added so LD_LIBRARY_PATH needs setting correctly for `bin/node` to find `lib/libnode.so`. For the `libnode.lib` vs `node.lib` issue there are two possible options: 1. Ensure `node.lib` from `node.exe` does not get generated, and instead copy `libnode.lib` to `node.lib`. This means addons compiled when referencing the correct `node.lib` file will correctly depend on `libnode.dll`. The down side is that native addons compiled with stock Node.js will still try to resolve symbols against node.exe rather than libnode.dll. 2. After building `libnode.dll`, dump the exports using `dumpbin`, and process this to generate a `node.def` file to be linked into `node.exe` with the `/DEF:node.def` flag. The export entries in `node.def` will all read ``` my_symbol=libnode.my_symbol ``` so that `node.exe` will redirect all exported symbols back to `libnode.dll`. This has the benefit that addons compiled with stock Node.js will load correctly into `node.exe` from a shared library build, but means that every embedding executable also needs to perform this same trick. I went with the first option as it is the cleaner of the two solutions in my opinion. Projects wishing to generate a shared library variant of Node.js can now, for example, ``` .\vcbuild dll package vs ``` to generate a full node installation including `libnode.dll`, `Release\node.lib`, and all the necessary headers. Native addons can then be built against the shared library build easily by specifying the correct `nodedir` option. For example ``` >npx node-gyp configure --nodedir C:\Users\User\node\Release\node-v18.0.0-win-x64 ... >npx node-gyp build ... >dumpbin /dependents build\Release\binding.node Microsoft (R) COFF/PE Dumper Version 14.29.30136.0 Copyright (C) Microsoft Corporation. All rights reserved. Dump of file build\Release\binding.node File Type: DLL Image has the following dependencies: KERNEL32.dll libnode.dll VCRUNTIME140.dll api-ms-win-crt-string-l1-1-0.dll api-ms-win-crt-stdio-l1-1-0.dll api-ms-win-crt-runtime-l1-1-0.dll ... ``` PR-URL: https://github.com/nodejs/node/pull/41850 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Beth Griggs <bgriggs@redhat.com> Reviewed-By: Richard Lau <rlau@redhat.com>
2022-05-05url: revert "validate ipv4 part length"Antoine du Hamel
This reverts commit 87d0d7a069b2a3ca1db1dd592a62db4645ba5d69. Refs: https://github.com/nodejs/node/pull/42915 PR-URL: https://github.com/nodejs/node/pull/42940 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-05-05bootstrap: use a context snapshotted with primordials in workersJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/42867 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-05-04src,crypto: remove uses of AllocatedBuffer from crypto_rsa.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/42852 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2022-05-04esm: add chaining to loadersJacob Smith
PR-URL: https://github.com/nodejs/node/pull/42623 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-05-03http: added connection closing methodsShogun
Fixes: https://github.com/nodejs/node/issues/41578 PR-URL: https://github.com/nodejs/node/pull/42812 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2022-05-02src: fix memory leak for v8.serializeliuxingbaoyu
When Buffer::New passes in existing data, it cannot be garbage collected in js synchronous execution. Fixes: https://github.com/nodejs/node/issues/40828 Refs: https://github.com/nodejs/node/issues/38300 PR-URL: https://github.com/nodejs/node/pull/42695 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2022-05-02bootstrap: fix wasm_web_api external reference registrationJoyee Cheung
The external references were not actually registered. PR-URL: https://github.com/nodejs/node/pull/42903 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2022-05-02src: add initial shadow realm supportlegendecas
Add initial shadow realm support behind an off-by-default flag `--experimental-shadow-realm`. PR-URL: https://github.com/nodejs/node/pull/42869 Refs: https://github.com/nodejs/node/issues/42528 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-05-01url: validate ipv4 part lengthYagiz Nizipli
PR-URL: https://github.com/nodejs/node/pull/42915 Fixes: https://github.com/nodejs/node/issues/42914 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-04-29v8: export cpu_profiler_metadata_size in getHeapCodeStatisticstheanarkh
PR-URL: https://github.com/nodejs/node/pull/42818 Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-04-28src: turn SSL_CTX_new CHECK/segfault into JS exceptionAnna Henningsen
These operations do not usually fail, but can do so when OpenSSL is not configured properly (I ran into this while dynamically linking against OpenSSL with FIPS). JS exceptions are way more useful than CHECK failures or plain segfaults. PR-URL: https://github.com/nodejs/node/pull/42799 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2022-04-28esm: graduate top-level-await to stableAntoine du Hamel
Removes the experimental label in the docs and makes the `--experimental-top-level-await` flag a no-op. V8 has removed the harmony flag in V8 9.1 and consider the feature stable, there's no reason to keep it experimental in Node.js. PR-URL: https://github.com/nodejs/node/pull/42875 Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2022-04-28src: make --no-node-snapshot a per-process optionJoyee Cheung
We enable the shared read-only heap which currently requires that the snapshot used in different isolates in the same process to be the same. Therefore --no-node-snapshot is a per-process option. PR-URL: https://github.com/nodejs/node/pull/42864 Refs: https://github.com/nodejs/node/pull/42809 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2022-04-27fs: fix mkdirSync so ENOSPC is correctly reportedSantiago Gimeno
Fixes: https://github.com/nodejs/node/issues/42808 PR-URL: https://github.com/nodejs/node/pull/42811 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2022-04-26lib,src: use Response URL as WebAssembly locationTobias Nießen
As per Section 3 of the WebAssembly Web API spec. PR-URL: https://github.com/nodejs/node/pull/42842 Refs: https://github.com/nodejs/node/pull/42701 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-04-24wasi: remove unecessary null checkMichael Dawson
As reported by coverity the null check is done after earlier code has already derefenced options.envp. Either we should null check earlier uses or this check is not necessary. Since options.envp is created with new which should throw an exception intead of returning null, it should be safe to assume the null check is not required. Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: https://github.com/nodejs/node/pull/42819 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-04-24src,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-23v8: 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-23lib,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-21src: 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-20src: 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-20doc: 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-20worker: 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-20doc: 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-19bootstrap: 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-19bootstrap: 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-192022-04-19, Version 18.0.0 (Current)Beth 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-17async_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-17src: 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-15test_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-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>