Commit Graph

12123 Commits

Author SHA1 Message Date
Rafael Gonzaga
b757a8f2b4
lib: remove util.getCallSite
This API has been replaced by util.getCallSites().

It was previously experimental with a warning about
its usage and its removal in a semver-minor PR. Here it
is.

PR-URL: https://github.com/nodejs/node/pull/59980
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-10-06 18:14:18 +00:00
Chengzhong Wu
d9b8a3558e
inspector: improve batch diagnostic channel subscriptions
PR-URL: https://github.com/nodejs/node/pull/60009
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-10-06 13:48:33 +00:00
Haram Jeong
5b3c4b37f6
http: improve writeEarlyHints by avoiding for-of loop
PR-URL: https://github.com/nodejs/node/pull/59958
Refs: https://github.com/nodejs/node/blob/main/doc/contributing/primordials.md#unsafe-array-iteration
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-10-06 09:11:45 +00:00
James M Snell
ed94bc48f3
src: update crypto.getCipherInfo() to use DictionaryTemplate
Also, have it use a null prototype

PR-URL: https://github.com/nodejs/node/pull/60036
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2025-10-05 14:05:35 +00:00
Gürgün Dayıoğlu
e978a63b01
lib: optimize priority queue
PR-URL: https://github.com/nodejs/node/pull/60039
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-10-04 22:08:00 +02:00
BCD1me
6f941fcfba
lib: implement passive listener behavior per spec
Implements the WHATWG DOM specification for passive event listeners,
ensuring that calls to `preventDefault()` are correctly ignored within
a passive listener context.

An internal `kInPassiveListener` state is added to the Event object
to track when a passive listener is executing. The `preventDefault()`
method and the `returnValue` setter are modified to check this state,
as well as the event's `cancelable` property. This state is reliably
cleaned up within a `finally` block to prevent state pollution in
case a listener throws an error.

This resolves previously failing Web Platform Tests (WPT) in
`AddEventListenerOptions-passive.any.js`.

Refs: https://dom.spec.whatwg.org/#dom-event-preventdefault
PR-URL: https://github.com/nodejs/node/pull/59995
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-10-04 03:17:35 +00:00
Shima Ryuhei
60f1a5d077
process: fix wrong asyncContext under unhandled-rejections=strict
Fixes: https://github.com/nodejs/node/issues/60034
PR-URL: https://github.com/nodejs/node/pull/60103
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2025-10-04 02:12:19 +00:00
Anna Henningsen
79f1999531
console: allow per-stream inspectOptions option
We (correctly) allow different streams to be specified for `stdout`
and `stderr`, so we should also allow different inspect options for
these streams.

PR-URL: https://github.com/nodejs/node/pull/60082
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2025-10-03 16:11:08 +02:00
Marco Ippolito
69144e96c2
module: use sync cjs when importing cts
PR-URL: https://github.com/nodejs/node/pull/60072
Fixes: https://github.com/nodejs/node/issues/59963
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2025-10-02 03:49:26 +00:00
Richard Lau
b8ea0e8e85
process: fix default env for process.execve
The `env` parameter for `process.execve` is documented to default
to `process.env`.

PR-URL: https://github.com/nodejs/node/pull/60029
Refs: https://github.com/nodejs/build/pull/4156
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-10-01 12:47:07 +00:00
Ruben Bridgewater
c2536adc28
console,util: improve array inspection performance
There is no need to do the own property check, since the descriptor
is needed right afterwards anyway.

PR-URL: https://github.com/nodejs/node/pull/60037
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2025-09-30 15:32:40 +02:00
Daniel M Brasil
3312e4e946
src: unflag --experimental-webstorage by default
PR-URL: https://github.com/nodejs/node/pull/57666
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-09-25 11:59:58 +00:00
theanarkh
24ded11b66
worker: add heap profile API
PR-URL: https://github.com/nodejs/node/pull/59846
Refs: https://github.com/nodejs/node/pull/59428
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-09-23 12:41:47 +00:00
Joyee Cheung
81af7b93c5
http,https: handle IPv6 with proxies
This simplifies the proxy configuration handling code,
 adds tests to make sure the proxy support works with IPv6
and throws correct errors for invalid proxy IPs.
Drive-by: remove useless properties from ProxyConfig

PR-URL: https://github.com/nodejs/node/pull/59894
Refs: https://github.com/nodejs/node/issues/57872
Reviewed-By: Aditi Singh <aditisingh1400@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-09-22 23:19:26 +00:00
Yoo
55cd2e589e
dgram: restore buffer optimization in fixBufferList
Restore the Buffer.isBuffer() check to avoid unnecessary Buffer.from()
calls when the input is already a Buffer. This improves performance
by 30-50% for buffer-heavy UDP operations.

Includes benchmark test for fixBufferList function to verify the
performance improvements across different data types and chunk sizes.

PR-URL: https://github.com/nodejs/node/pull/59934
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2025-09-21 17:50:41 +00:00
Miguel Marcondes Filho
aa6838c252
lib: update inspect output format for subclasses
PR-URL: https://github.com/nodejs/node/pull/59687
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2025-09-21 06:28:45 +00:00
Nam Yooseong
39d73036e7
lib: use validators for argument validation
This refactors internal validation helpers in `child_process` to use
the common validators in `lib/internal/validators.js` where possible.

This improves code consistency and maintainability.

PR-URL: https://github.com/nodejs/node/pull/59416
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-09-21 02:47:14 +00:00
Tim Perry
2a0fcdbc88
http2: fix allowHttp1+Upgrade, broken by shouldUpgradeCallback
This is required to use HTTP/1 websockets on an HTTP/2 server, which is
fairly common as websockets over HTTP/2 is much less widely supported.

This was broken by the recent shouldUpgradeCallback HTTP/1 addition,
which wasn't correctly added to the corresponding allowHttp1 part of
the HTTP/2 implementation.

PR-URL: https://github.com/nodejs/node/pull/59924
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-09-20 18:18:23 +00:00
Chengzhong Wu
4612c793cb
vm: expose hasTopLevelAwait on SourceTextModule
Some checks are pending
Coverage Linux (without intl) / coverage-linux-without-intl (push) Waiting to run
Coverage Linux / coverage-linux (push) Waiting to run
Coverage Windows / coverage-windows (push) Waiting to run
Test and upload documentation to artifacts / build-docs (push) Waiting to run
Linters / lint-addon-docs (push) Waiting to run
Linters / lint-cpp (push) Waiting to run
Linters / format-cpp (push) Waiting to run
Linters / lint-js-and-md (push) Waiting to run
Linters / lint-py (push) Waiting to run
Linters / lint-yaml (push) Waiting to run
Linters / lint-sh (push) Waiting to run
Linters / lint-codeowners (push) Waiting to run
Linters / lint-pr-url (push) Waiting to run
Linters / lint-readme (push) Waiting to run
Notify on Push / Notify on Force Push on `main` (push) Waiting to run
Notify on Push / Notify on Push on `main` that lacks metadata (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Expose `hasTopLevelAwait` and `hasAsyncGraph` on
`vm.SourceTextModule`.

`hasAsyncGraph` requires the module to be instantiated first.

PR-URL: https://github.com/nodejs/node/pull/59865
Fixes: https://github.com/nodejs/node/issues/59656
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-09-19 09:12:17 +00:00
Ugaitz Urien
897932c484
diagnostics_channel: fix race condition with diagnostics_channel and GC
PR-URL: https://github.com/nodejs/node/pull/59910
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2025-09-19 07:28:39 +00:00
Joyee Cheung
d94735c17a tls: only do off-thread certificate loading on loading tls
This patch makes the off-thread loading lazy and only done when the
`tls` builtin is actually loaded by the application. Thus if the
application never uses tls, it would not get hit by the extra
off-thread loading overhead. paving the way to enable --use-system-ca
by default.

PR-URL: https://github.com/nodejs/node/pull/59856
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-09-18 18:54:14 +00:00
Tim Perry
65bee02cca
http: add shouldUpgradeCallback to let servers control HTTP upgrades
Previously, you could either add no 'upgrade' event handler, in which
case all upgrades were ignored, or add an 'upgrade' handler and all
upgrade attempts would effectively succeed and skip normal request
handling. This change adds a new shouldUpgradeCallback option to HTTP
servers, which receives the request details and returns a boolean that
controls whether the request should be upgraded.

PR-URL: https://github.com/nodejs/node/pull/59824
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-09-17 15:14:01 +00:00
Joyee Cheung
c46260284c
module: only put directly require-d ESM into require.cache
This reduces the impact of
https://redirect.github.com/nodejs/node/pull/59679
by delaying the require.cache population of ESM until they
are directly required. After that, it's necessary for them
to be in the cache to maintain correctness.

PR-URL: https://github.com/nodejs/node/pull/59874
Refs: https://github.com/nodejs/node/issues/59868
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2025-09-17 13:13:59 +00:00
Michael Smith
e596098e50
src: reduce the nearest parent package JSON cache size
PR-URL: https://github.com/nodejs/node/pull/59888
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2025-09-17 10:26:52 +00:00
Matteo Collina
1ebe88f87c
stream: use new AsyncResource instead of bind
Some checks are pending
Coverage Linux (without intl) / coverage-linux-without-intl (push) Waiting to run
Coverage Linux / coverage-linux (push) Waiting to run
Coverage Windows / coverage-windows (push) Waiting to run
Test and upload documentation to artifacts / build-docs (push) Waiting to run
Linters / lint-addon-docs (push) Waiting to run
Linters / lint-cpp (push) Waiting to run
Linters / format-cpp (push) Waiting to run
Linters / lint-js-and-md (push) Waiting to run
Linters / lint-py (push) Waiting to run
Linters / lint-yaml (push) Waiting to run
Linters / lint-sh (push) Waiting to run
Linters / lint-codeowners (push) Waiting to run
Linters / lint-pr-url (push) Waiting to run
Linters / lint-readme (push) Waiting to run
Notify on Push / Notify on Force Push on `main` (push) Waiting to run
Notify on Push / Notify on Push on `main` that lacks metadata (push) Waiting to run
The bind method uses ObjectDefineProperty that shows up
in flamegraphs. This changes it to avoid the utility.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/59867
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2025-09-16 20:24:38 +00:00
Patrick Costa
64a8b4b1ba
crypto: expose signatureAlgorithm on X509Certificate
Some checks are pending
Coverage Linux (without intl) / coverage-linux-without-intl (push) Waiting to run
Coverage Linux / coverage-linux (push) Waiting to run
Coverage Windows / coverage-windows (push) Waiting to run
Test and upload documentation to artifacts / build-docs (push) Waiting to run
Notify on Push / Notify on Force Push on `main` (push) Waiting to run
Notify on Push / Notify on Push on `main` that lacks metadata (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Adds the `signatureAlgorithm` property to a X509Certificate allowing
users to retrieve a string representing the algorithm used to sign the
certificate. This string is defined by the OpenSSL library.

Fixes: https://github.com/nodejs/node/issues/59103
PR-URL: https://github.com/nodejs/node/pull/59235
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2025-09-16 19:27:04 +00:00
방진혁
c8c6bfab23
http: optimize checkIsHttpToken for short strings
Some checks are pending
Coverage Linux (without intl) / coverage-linux-without-intl (push) Waiting to run
Coverage Linux / coverage-linux (push) Waiting to run
Coverage Windows / coverage-windows (push) Waiting to run
Test and upload documentation to artifacts / build-docs (push) Waiting to run
Notify on Push / Notify on Force Push on `main` (push) Waiting to run
Notify on Push / Notify on Push on `main` that lacks metadata (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Use lookup table instead of regex for strings shorter than 10
characters to improve performance for common short header names
while maintaining compatibility.

PR-URL: https://github.com/nodejs/node/pull/59832
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2025-09-14 00:40:06 +00:00
Miguel Marcondes Filho
4ed9d21880
lib: update isDeepStrictEqual to support options
PR-URL: https://github.com/nodejs/node/pull/59762
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2025-09-14 00:39:49 +00:00
Mikhail
1442023134
url: replaced slice with at
PR-URL: https://github.com/nodejs/node/pull/59181
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2025-09-14 00:39:32 +00:00
Ruben Bridgewater
60c1fbcf65
util: inspect objects with throwing Symbol.toStringTag
`util.inspect()` should handle all kinds of input, even if it is
not well defined. Throwing is something that is meant to be worked
around in all known cases. This fixes issues inspecting objects
where accessing the Symbol.toStringTag would cause an error. The
symbol is just ignored in that case.

Refs: https://github.com/nodejs/node/issues/55539
Refs: https://github.com/nodejs/node/pull/55544
PR-URL: https://github.com/nodejs/node/pull/59860
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-09-14 00:07:06 +00:00
Ruben Bridgewater
0319ba51d8
util: fix debuglog.enabled not being present with callback logger
The method returned by the callback is missing the .enabled property.
This is added in a consistent way that it also verifies that it's a
getter.

Fixes: https://github.com/nodejs/node/issues/56676
PR-URL: https://github.com/nodejs/node/pull/59858
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-09-14 00:06:57 +00:00
Ruben Bridgewater
49f79b8e93
repl: fix cpu overhead pasting big strings to the REPL
Pasting input should not trigger any completions and other
calculations. This is now handled by just writing the string to the
terminal in case the user is pasting. As soon as pasting is done,
the completions will be re-enabled.

Fixes: https://github.com/nodejs/node/issues/40626
Fixes: https://github.com/nodejs/node/issues/43343
PR-URL: https://github.com/nodejs/node/pull/59857
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-09-14 00:06:47 +00:00
Renegade334
8869210dd8 crypto: use return await when returning Promises from async functions
This offers _some_ resistance to `%Promise.prototype%` pollution.

Refs: https://github.com/nodejs/node/issues/59699
PR-URL: https://github.com/nodejs/node/pull/59841
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2025-09-12 14:21:50 +00:00
Renegade334
7a205d0ac0 crypto: use async functions for non-stub Promise-returning functions
These were intended to mimic simple async functions, but exceptions
thrown in the function body would be returned synchronously, not
wrapped in a rejected Promise.

PR-URL: https://github.com/nodejs/node/pull/59841
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2025-09-12 14:21:49 +00:00
Renegade334
33e3e423d9 crypto: avoid calls to promise.catch()
This avoids explicit calls to the user-mutable
`%Promise.prototype%.catch`, and by association, implicit calls to the
user-mutable `%Promise.prototype%.then`.

PR-URL: https://github.com/nodejs/node/pull/59841
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2025-09-12 14:21:49 +00:00
simon-id
95ab4eb6ad
url: add type checking to urlToHttpOptions()
PR-URL: https://github.com/nodejs/node/pull/59753
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
2025-09-12 12:59:26 +00:00
Aditi
94422e8a40
src: add an option to make compile cache portable
Adds an option (NODE_COMPILE_CACHE_PORTABLE) for
the built-in compile cache to encode the hashes with
relative file paths. On enabling the option,
the source directory along with cache directory can be
bundled and moved, and the cache continues to work.

When enabled, paths encoded in hash are relative to
compile cache directory.

PR-URL: https://github.com/nodejs/node/pull/58797
Fixes: https://github.com/nodejs/node/issues/58755
Refs: https://github.com/nodejs/node/issues/52696
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-09-12 11:00:39 +00:00
Rafael Gonzaga
29738c7b42
src,permission: add --allow-inspector ability
Some checks are pending
Coverage Linux (without intl) / coverage-linux-without-intl (push) Waiting to run
Coverage Linux / coverage-linux (push) Waiting to run
Coverage Windows / coverage-windows (push) Waiting to run
Test and upload documentation to artifacts / build-docs (push) Waiting to run
Linters / lint-addon-docs (push) Waiting to run
Linters / lint-cpp (push) Waiting to run
Linters / format-cpp (push) Waiting to run
Linters / lint-js-and-md (push) Waiting to run
Linters / lint-py (push) Waiting to run
Linters / lint-yaml (push) Waiting to run
Linters / lint-sh (push) Waiting to run
Linters / lint-codeowners (push) Waiting to run
Linters / lint-pr-url (push) Waiting to run
Linters / lint-readme (push) Waiting to run
Notify on Push / Notify on Force Push on `main` (push) Waiting to run
Notify on Push / Notify on Push on `main` that lacks metadata (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Refs: https://github.com/nodejs/node/issues/48534
PR-URL: https://github.com/nodejs/node/pull/59711
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2025-09-11 20:10:02 +00:00
Chengzhong Wu
c742220be9
lib,src: cache ModuleWrap.hasAsyncGraph
`v8::Module::IsGraphAsync()` traverses the dependencies to find if they
contain TLA each time. `ModuleWrap.hasAsyncGraph` caches the result
and exposes the property to JS land so that the presence of the property
`module.hasAsyncGraph` can be consistent.

This also allows C++ access of cached `hasAsyncGraph`.

This merges the `intantiateSync`/`instantiate` and
`getNamespaceSync`/`getNamespace` as they are always sync.

PR-URL: https://github.com/nodejs/node/pull/59703
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-09-11 12:54:24 +00:00
Chengzhong Wu
f1b56d6200 lib: add source map support for assert messages
Map source lines in assert messages with cached source maps.

PR-URL: https://github.com/nodejs/node/pull/59751
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-09-11 10:37:46 +00:00
Chengzhong Wu
d35bd2088e lib,src: refactor assert to load error source from memory
The source code is available from V8 API and assert can avoid reading
the source file from the filesystem and parse the file again.

PR-URL: https://github.com/nodejs/node/pull/59751
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-09-11 10:37:45 +00:00
Robert Nagy
7d0f6be9d1
http: unbreak keepAliveTimeoutBuffer
Some checks are pending
Coverage Linux (without intl) / coverage-linux-without-intl (push) Waiting to run
Coverage Linux / coverage-linux (push) Waiting to run
Coverage Windows / coverage-windows (push) Waiting to run
Test and upload documentation to artifacts / build-docs (push) Waiting to run
Linters / lint-addon-docs (push) Waiting to run
Linters / lint-cpp (push) Waiting to run
Linters / format-cpp (push) Waiting to run
Linters / lint-js-and-md (push) Waiting to run
Linters / lint-py (push) Waiting to run
Linters / lint-yaml (push) Waiting to run
Linters / lint-sh (push) Waiting to run
Linters / lint-codeowners (push) Waiting to run
Linters / lint-pr-url (push) Waiting to run
Linters / lint-readme (push) Waiting to run
Notify on Push / Notify on Force Push on `main` (push) Waiting to run
Notify on Push / Notify on Push on `main` that lacks metadata (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Adds a guard.

PR-URL: https://github.com/nodejs/node/pull/59784
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-09-09 19:23:09 +00:00
Haram Jeong
402a02fe2b
assert: cap input size in myersDiff to avoid Int32Array overflow
PR-URL: https://github.com/nodejs/node/pull/59578
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2025-09-09 00:36:14 +00:00
sangwook
670d7ab7f2
util: fix numericSeparator with negative fractional numbers
Some checks are pending
Coverage Linux (without intl) / coverage-linux-without-intl (push) Waiting to run
Coverage Linux / coverage-linux (push) Waiting to run
Coverage Windows / coverage-windows (push) Waiting to run
Test and upload documentation to artifacts / build-docs (push) Waiting to run
Linters / lint-addon-docs (push) Waiting to run
Linters / lint-cpp (push) Waiting to run
Linters / format-cpp (push) Waiting to run
Linters / lint-js-and-md (push) Waiting to run
Linters / lint-py (push) Waiting to run
Linters / lint-yaml (push) Waiting to run
Linters / lint-sh (push) Waiting to run
Linters / lint-codeowners (push) Waiting to run
Linters / lint-pr-url (push) Waiting to run
Linters / lint-readme (push) Waiting to run
Notify on Push / Notify on Force Push on `main` (push) Waiting to run
Notify on Push / Notify on Push on `main` that lacks metadata (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Fix util.inspect() formatting bug where negative fractional numbers
between -1 and 0 lost their minus sign when numericSeparator was true.
Fixed formatNumber function to preserve sign by using original string
representation. Also corrected test expectations for scientific notation
to not apply numeric separators.
Fixes: https://github.com/nodejs/node/issues/59376

PR-URL: https://github.com/nodejs/node/pull/59379
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-09-08 20:10:50 +00:00
Lee Jiho
26607a650e
path: refactor path joining logic for clarity and performance
PR-URL: https://github.com/nodejs/node/pull/59781
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-09-08 18:44:18 +00:00
Joyee Cheung
916929863d
esm: populate separate cache for require(esm) in imported CJS
Otherwise if the ESM happens to be cached separately by the ESM loader
before it gets loaded with `require(esm)` from within an imported
CJS file (which uses a re-invented require() with a couple of quirks,
including a separate cache), it won't be able to load the esm properly
from the cache.

PR-URL: https://github.com/nodejs/node/pull/59679
Refs: https://github.com/nodejs/node/issues/59666
Refs: https://github.com/nodejs/node/issues/52697
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-09-08 14:59:31 +00:00
Anna Henningsen
6cf64af44d
repl: do not cause side effects in tab completion
A number of recent changes to the REPL tab completion logic have
introduced the ability for completion to cause side effects,
specifically, calling arbitrary functions or variable
assignments/updates.

This was first introduced in 07220230d9 and the problem exacerbated in
8ba66c5e7b. Our team noticed this because our tests started failing
when attempting to update to Node.js 20.19.5.

Some recent commits, such as 1093f38c43 or 69453378fc, have
messages or PR descriptions that imply the intention to avoid side
effects, which I can can generally be agreed upon is in line with the
expectations that a user has of autocomplete functionality.
However, some of the tests introduced in those commts specifically
verify that side effects *can* happen under specific circunmstances.
I am assuming here that this is unintentional, and the corresponding
tests have been removed/replaced in this commit.

Fixes: https://github.com/nodejs/node/issues/59731
Fixes: https://github.com/nodejs/node/issues/58903
Refs: https://github.com/nodejs/node/pull/58709
Refs: https://github.com/nodejs/node/pull/58775
Refs: https://github.com/nodejs/node/pull/57909
Refs: https://github.com/nodejs/node/pull/58891
PR-URL: https://github.com/nodejs/node/pull/59774
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Dario Piotrowicz <dario.piotrowicz@gmail.com>
2025-09-08 13:54:45 +00:00
Robert Nagy
73b50220c7
http: use cached '1.1' http version string
PR-URL: https://github.com/nodejs/node/pull/59717
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-09-08 09:27:29 +00:00
Yoo
303677b362
Revert "lib: optimize writable stream buffer clearing"
This reverts commit 8a2fec1f6f.

PR-URL: https://github.com/nodejs/node/pull/59743
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-09-08 08:11:20 +00:00
James M Snell
b4af647920 quic: reduce boilerplate and other minor cleanups
While I get that macros aren't the most loved thing in
the world, they do help reduce boilerplate, and there's
a lot of boilerplate in the QUIC code. This commit cleans
up some of that boilerplate, particularly around the
use of v8 APIs.

PR-URL: https://github.com/nodejs/node/pull/59342
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-09-07 19:29:02 -07:00
James M Snell
cd9fd09a27 quic: multiple fixups and updates
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/59342
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-09-07 19:29:01 -07:00
btea
3135477d4a
util: remove unnecessary template strings
PR-URL: https://github.com/nodejs/node/pull/59201
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2025-09-07 21:47:02 +00:00
Filip Skokan
d6221f6f51
crypto: refactor subtle methods to use synchronous import
Refs: #59699
PR-URL: https://github.com/nodejs/node/pull/59771
Refs: https://github.com/nodejs/node/issues/59699
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-09-07 20:59:27 +00:00
Aviv Keller
e1d4d6ab49
repl: eol deprecate instantiating without new
PR-URL: https://github.com/nodejs/node/pull/59495
Refs: https://github.com/nodejs/node/pull/54869
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2025-09-07 19:08:39 +00:00
Filip Skokan
a3cd430ef8 crypto: support Ed448 and ML-DSA context parameter in node:crypto
PR-URL: https://github.com/nodejs/node/pull/59570
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-09-07 13:17:42 +00:00
Filip Skokan
0124e0e0d7 crypto: support Ed448 and ML-DSA context parameter in Web Cryptography
PR-URL: https://github.com/nodejs/node/pull/59570
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-09-07 13:17:42 +00:00
haramjeong
3837993b65 util: remove outdated TODO comment
PR-URL: https://github.com/nodejs/node/pull/59760
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-09-07 13:04:52 +00:00
haramjeong
b3cfa5b734 util: use getOptionValue('--no-deprecation') in deprecated()
PR-URL: https://github.com/nodejs/node/pull/59760
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-09-07 13:04:51 +00:00
Filip Skokan
6478dd0e28
lib: prefer TypedArrayPrototype primordials
Refs: #59699
PR-URL: https://github.com/nodejs/node/pull/59766
Refs: https://github.com/nodejs/node/issues/59699
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2025-09-07 12:34:43 +00:00
Filip Skokan
14c68e3b53
crypto: add KMAC Web Cryptography algorithms
PR-URL: https://github.com/nodejs/node/pull/59647
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-09-06 22:43:15 +00:00
Kingsword
57bc1778a3
repl: fix REPL completion under unary expressions
PR-URL: https://github.com/nodejs/node/pull/59744
Fixes: https://github.com/nodejs/node/issues/59735
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2025-09-05 17:37:04 +00:00
Ruben Bridgewater
0f58a3d0cb
util: hide duplicated stack frames when using util.inspect
Long stack traces often have duplicated stack frames from recursive
calls. These make it difficult to identify important parts of the
stack. This hides the duplicated ones and notifies the user which
lines were hidden.

PR-URL: https://github.com/nodejs/node/pull/59447
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2025-09-05 17:15:12 +00:00
Joyee Cheung
8e2b093c07
url: add err.input to ERR_INVALID_FILE_URL_PATH
Otherwise there's no information from the error about what exactly
is the invalid URL.

PR-URL: https://github.com/nodejs/node/pull/59730
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2025-09-05 17:03:16 +00:00
Ruben Bridgewater
fdef0725de
util,console: colorize regexp groups, character classes, etc
This adds a parser to parse the regular expression and to highlight
different parts of a regular expression in case colors are active.

It is a one time pass algorithm and should therefore not cause too
much overhead during parsing.

As side effect, it is now possible to create individual styles to
colorize inspected values values as a user likes. This might for
example be expanded to numbers with numeric separators, highlighting
the separators or decimal points different.

It would in theory also be possible to return a changed string.
That is however not the intention for this API as it is only
triggered in case colors are active.

PR-URL: https://github.com/nodejs/node/pull/59710
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2025-09-05 14:29:21 +00:00
Joyee Cheung
6428e2e4ca
sea: implement sea.getAssetKeys()
This adds a new API to allow the bundled script in SEA to query
the list of assets.

PR-URL: https://github.com/nodejs/node/pull/59661
Refs: https://github.com/nodejs/single-executable/discussions/112
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2025-09-04 11:58:50 +00:00
Joyee Cheung
3ffc3d73ac
esm: fix missed renaming in ModuleJob.runSync
https://redirect.github.com/nodejs/node/pull/59675 missed a case
when renaming .async to .hasAsyncGraph. This fixes that and add
a test that would previously crash with the missed rename.

PR-URL: https://github.com/nodejs/node/pull/59724
Refs: https://github.com/nodejs/node/pull/59675
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-09-04 10:01:32 +00:00
Moshe Atlow
2258f22672
test_runner: fix todo inheritance
PR-URL: https://github.com/nodejs/node/pull/59721
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-09-04 09:35:48 +00:00
theanarkh
255dd7b62c
worker: optimize cpu profile implement
PR-URL: https://github.com/nodejs/node/pull/59683
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2025-09-01 16:25:48 +00:00
Joyee Cheung
fb22c7f414
src: separate module.hasAsyncGraph and module.hasTopLevelAwait
Clarify the names - hasAsyncGraph means either the module or its
dependencies contains top-level await; hasTopLevelAwait means the
module itself contains top-level await. Theoratically the former
can be inferred from iterating over the dependencies but for the
built-in loader it's currently not fully reliable until we eliminate
async linking.

Also remove the hasTopLevelAwait method - we can simply put it
on the module wrap for source text modules right after compilation.

PR-URL: https://github.com/nodejs/node/pull/59675
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-09-01 14:59:04 +00:00
Chengzhong Wu
dddc4a5972
lib: fix DOMException subclass support
PR-URL: https://github.com/nodejs/node/pull/59680
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2025-08-31 17:20:02 +00:00
방진혁
eefe3b14bf
stream: replace manual function validation with validateFunction
Replace repetitive manual function type checking with the existing
validateFunction in multiple stream operator functions.

PR-URL: https://github.com/nodejs/node/pull/59529
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-08-30 14:37:15 +00:00
René
196f5466af
lib: revert to using default derived class constructors
PR-URL: https://github.com/nodejs/node/pull/59650
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-08-30 14:28:10 +00:00
theanarkh
ac92c928ef
worker: add cpu profile APIs for worker
PR-URL: https://github.com/nodejs/node/pull/59428
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2025-08-29 15:42:21 +00:00
Chengzhong Wu
95bef5af88
vm: sync-ify SourceTextModule linkage
Split `module.link(linker)` into two synchronous step
`sourceTextModule.linkRequests()` and
`sourceTextModule.instantiate()`. This allows creating vm modules and
resolving the dependencies in a complete synchronous procedure.

This also makes `syntheticModule.link()` redundant. The link step for a
SyntheticModule is no-op and is already taken care in the constructor
by initializing the binding slots with the given export names.

PR-URL: https://github.com/nodejs/node/pull/59000
Refs: https://github.com/nodejs/node/issues/37648
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-29 12:17:18 +00:00
Xuguang Mei
ebd2da6d11
repl: add isValidParentheses check before wrap input
PR-URL: https://github.com/nodejs/node/pull/59607
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-08-27 17:32:01 +00:00
Darshan Sen
c86c488e18
inspector: add http2 tracking support
This allows tracking HTTP/2 calls through the Network tab of
Chrome DevTools for Node.js.

Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/59611
Refs: https://github.com/nodejs/node/issues/53946
Reviewed-By: Ryuhei Shima <shimaryuhei@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
2025-08-27 16:25:13 +00:00
hotpineapple
ec8c73d6ca
test_runner: set mock timer's interval undefined
prevent adding timer to execution queue if clearInterval() called

PR-URL: https://github.com/nodejs/node/pull/59479
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-08-27 03:36:54 +00:00
Filip Skokan
27e2d81617
crypto: add Argon2 Web Cryptography algorithms
PR-URL: https://github.com/nodejs/node/pull/59544
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-08-26 16:05:56 +00:00
Filip Skokan
d00228f5ca
crypto: support SLH-DSA KeyObject, sign, and verify
PR-URL: https://github.com/nodejs/node/pull/59537
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2025-08-26 15:41:25 +00:00
Filip Skokan
8692e601cc
crypto: add AES-OCB Web Cryptography algorithm
PR-URL: https://github.com/nodejs/node/pull/59539
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-08-24 09:47:20 +00:00
René
52f616d42f
test_runner: do not error when getting fullName of root context
PR-URL: https://github.com/nodejs/node/pull/59377
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2025-08-23 19:40:58 +00:00
Filip Skokan
589ef79bf8
crypto: support ML-KEM in Web Cryptography
PR-URL: https://github.com/nodejs/node/pull/59569
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-08-23 17:01:51 +02:00
Filip Skokan
0fab11805f
crypto: require HMAC key length with SHA-3 hashes in Web Cryptography
PR-URL: https://github.com/nodejs/node/pull/59567
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2025-08-23 10:25:50 +00:00
Filip Skokan
7178e9141a
crypto: fix subtle.getPublicKey error for secret type key inputs
PR-URL: https://github.com/nodejs/node/pull/59558
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2025-08-22 15:56:56 +00:00
Filip Skokan
d30090b427 crypto: return cached copies from CryptoKey algorithm and usages getters
Fixes: https://github.com/nodejs/node/issues/59534
PR-URL: https://github.com/nodejs/node/pull/59538
Fixes: https://github.com/nodejs/node/issues/59535
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-08-21 14:14:57 +00:00
Filip Skokan
9d744b5b63 crypto: use CryptoKey internal slots in Web Cryptography
PR-URL: https://github.com/nodejs/node/pull/59538
Fixes: https://github.com/nodejs/node/issues/59535
Fixes: https://github.com/nodejs/node/issues/59534
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-08-21 14:14:57 +00:00
Filip Skokan
7a47cbf4c5 crypto: normalize RsaHashedKeyParams publicExponent
Fixes: https://github.com/nodejs/node/issues/59535
PR-URL: https://github.com/nodejs/node/pull/59538
Fixes: https://github.com/nodejs/node/issues/59534
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-08-21 14:14:56 +00:00
Tim Perry
b5e8247339
http2: add support for raw header arrays in h2Stream.respond()
PR-URL: https://github.com/nodejs/node/pull/59455
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2025-08-21 11:18:10 +00:00
Khafra
44d9e6d8ad
stream: add brotli support to CompressionStream and DecompressionStream
Refs: https://github.com/whatwg/compression/issues/34
PR-URL: https://github.com/nodejs/node/pull/59464
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-08-21 02:22:19 +00:00
Joyee Cheung
7535aa1f72 esm: link modules synchronously when no async loader hooks are used
When no async loader hooks are registered, perform the linking as
synchronously as possible to reduce the chance of races from the
the shared module loading cache.

PR-URL: https://github.com/nodejs/node/pull/59519
Fixes: https://github.com/nodejs/node/issues/59366
Refs: https://github.com/abejfehr/node-22.18-issue-repro
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-08-20 14:31:08 +00:00
Joyee Cheung
db70ceb49f esm: show race error message for inner module job race
The race can not only happen when the ESM is loaded by
the CommonJS loader, but can also happen to inner
module jobs in the dependency graph.

PR-URL: https://github.com/nodejs/node/pull/59519
Fixes: https://github.com/nodejs/node/issues/59366
Refs: https://github.com/abejfehr/node-22.18-issue-repro
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-08-20 14:31:08 +00:00
Filip Skokan
f8d68d30ae
crypto: support ML-KEM, DHKEM, and RSASVE key encapsulation mechanisms
PR-URL: https://github.com/nodejs/node/pull/59491
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-08-20 14:30:58 +00:00
Krishnadas PC
6c215fb746
http: trim off brackets from IPv6 addresses with string operations
This is simpler than using regular expressions.

PR-URL: https://github.com/nodejs/node/pull/59420
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-08-20 11:34:26 +00:00
Ranieri Althoff
bdcab711b8
crypto: add argon2() and argon2Sync() methods
Co-authored-by: Filip Skokan <panva.ip@gmail.com>
Co-authored-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/50353
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-08-19 19:30:38 +00:00
hotpineapple
a97562896f
child_process: remove unsafe array iteration
PR-URL: https://github.com/nodejs/node/pull/59347
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-08-19 18:14:48 +02:00
Filip Skokan
eaf1c15749
crypto: support ML-DSA spki/pkcs8 key formats in Web Cryptography
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:57:27 +02:00
Filip Skokan
5329f73816
lib: refactor kSupportedAlgorithms
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:57:25 +02:00
Filip Skokan
0cc2c83e32
crypto: subject some algorithms in Web Cryptography on BoringSSL absence
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:57:23 +02:00
Filip Skokan
84aaed7597
crypto: add ChaCha20-Poly1305 Web Cryptography algorithm
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:57:08 +02:00
Filip Skokan
f4741ef8df
crypto: add subtle.getPublicKey() utility function in Web Cryptography
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:55:58 +02:00
Filip Skokan
1c4d534b75
crypto: add SHA-3 Web Cryptography digest algorithms
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:55:57 +02:00
Filip Skokan
327618c430
crypto: add SHAKE Web Cryptography digest algorithms
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:55:56 +02:00
Filip Skokan
90ec54345d
crypto: add SubtleCrypto.supports feature detection in Web Cryptography
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:55:54 +02:00
Filip Skokan
87f4f99c09
crypto: support ML-DSA in Web Cryptography
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:55:53 +02:00
Ruben Bridgewater
7c9fbc15bc
assert,util: fail promise comparison in deep equal checks
It is impossible to look into the content of a promise and its
state. This aligns the comparison with WeakMaps and WeakSets.
Only reference equal promises will pass the check in the future.

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

PR-URL: https://github.com/nodejs/node/pull/59448
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2025-08-19 10:22:35 +00:00
Ruben Bridgewater
8973589620
util: fix error's namespaced node_modules highlighting using inspect
When inspecting errors, node_modules are highlighted with an
underscore. So far namespaced modules only highlighted the namespace
but not the rest of the module name. This is fixed by matching the
full name.
As drive-by it improves the performance slightly by removing the
regular expression in favor of indexOf to identify the right spot.

PR-URL: https://github.com/nodejs/node/pull/59446
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2025-08-19 10:22:25 +00:00
Shima Ryuhei
ee9c8cf0cb
inspector: initial support websocket inspection
Refs: https://github.com/nodejs/node/issues/53946
PR-URL: https://github.com/nodejs/node/pull/59404
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-08-19 10:09:14 +00:00
Mark S. Miller
3f51cb6229
util: add some additional error classes to wellKnownPrototypes
PR-URL: https://github.com/nodejs/node/pull/59456
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-08-19 11:00:24 +02:00
Moshe Atlow
64355ae97e
test_runner: add option to rerun only failed tests
PR-URL: https://github.com/nodejs/node/pull/59443
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-08-19 07:42:00 +00:00
Richie Bendall
663554abdf
lib: expose global ErrorEvent
PR-URL: https://github.com/nodejs/node/pull/58920
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2025-08-18 08:14:54 +00:00
Darshan Sen
7f3a150388
http2: report sent headers object in client stream dcs
This change improves diagnosis by reporting the headers object that is
actually sent rather than the original input headers in the following
diagnostics channels:
- 'http2.client.stream.created'
- 'http2.client.stream.start'

Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/59419
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-08-17 05:29:41 +00:00
Filip Skokan
66e25cf1b3
crypto: support ML-KEM KeyObject
PR-URL: https://github.com/nodejs/node/pull/59461
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-08-16 14:39:14 +00:00
Pietro Marchini
abb1f92347
src: add internal GetOptionsAsFlags
PR-URL: https://github.com/nodejs/node/pull/59138
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-08-16 06:43:49 +00:00
Joyee Cheung
af5d1c93ce
esm: sync-ify module translation
This completes the TODO to compile WASM synchronously and thus
making translation (i.e. compilation + instantiation) synchronous.

PR-URL: https://github.com/nodejs/node/pull/59453
Refs: https://github.com/nodejs/node/issues/55782
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-08-14 14:28:40 +00:00
Antoine du Hamel
91f035e597
assert: resolve TODO and rename function
PR-URL: https://github.com/nodejs/node/pull/59451
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2025-08-14 09:51:13 +00:00
Sungwon
f7a2ba7e83
test_runner: fix isSkipped check in junit
The `isSkipped` function in the JUnit reporter was incorrectly
checking for `node?.attrs.failures` instead of `node?.attrs.skipped`.

PR-URL: https://github.com/nodejs/node/pull/59414
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
2025-08-13 08:50:42 +00:00
Haram Jeong
a4b4eca94c
http: add Agent.agentKeepAliveTimeoutBuffer option
PR-URL: https://github.com/nodejs/node/pull/59315
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
2025-08-13 02:32:30 +00:00
Shima Ryuhei
ad292b8e4f
inspector: prevent propagation of promise hooks to noPromise hooks
PR-URL: https://github.com/nodejs/node/pull/58841
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-08-12 09:14:18 +00:00
Krishnadas
eed1d33c53
lib: simplify IPv6 checks in isLoopback()
The checks for '[::1]' and '[0:0:0:0:0:0:0:1]'
in isLoopback were using startsWith,
which is unnecessary as these are canonical
loopback addresses with no valid prefixes.

Switching to strict equality improves
clarity and improves performance.

PR-URL: https://github.com/nodejs/node/pull/59375
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
2025-08-12 11:00:11 +02:00
theanarkh
b87312ba08
lib: add trace-sigint APIs
PR-URL: https://github.com/nodejs/node/pull/59040
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-08-11 09:14:44 +00:00
Shima Ryuhei
220f5c644e
test: exclude mock from coverage
Fixes: https://github.com/nodejs/node/issues/59112
PR-URL: https://github.com/nodejs/node/pull/59348
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
2025-08-11 05:49:53 +00:00
Yoo
8a2fec1f6f
lib: optimize writable stream buffer clearing
Improved the `clearBuffer` function
by replacing `buffered.splice` with `ArrayPrototypeSlice`.
- Eliminates O(N) shifting overhead.
- Improves CPU utilization and reduces GC overhead.

PR-URL: https://github.com/nodejs/node/pull/59406
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2025-08-11 03:29:01 +00:00
Rafael Gonzaga
a73b575304
lib: handle windows reserved device names on UNC
We have found that UNC paths weren't covered
when .join/.normalize windows reserved device
names (COM1, LPT1).

PR-URL: https://github.com/nodejs/node/pull/59286
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-08-09 12:54:53 +00:00
방진혁
f3adc11e37
assert: change utils to use index instead of for...of
PR-URL: https://github.com/nodejs/node/pull/59278
Refs: https://github.com/nodejs/node/blob/main/doc/contributing/primordials.md#unsafe-array-iteration
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
2025-08-07 22:47:09 +00:00
Filip Skokan
24e28c41b5
crypto: support ML-DSA KeyObject, sign, and verify
PR-URL: https://github.com/nodejs/node/pull/59259
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-08-06 21:49:30 +00:00
Miguel Marcondes Filho
4f5d11e6fb
lib: restructure assert to become a class
PR-URL: https://github.com/nodejs/node/pull/58253
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-08-05 14:15:02 +00:00
theanarkh
3090def635
worker: add name for worker
PR-URL: https://github.com/nodejs/node/pull/59213
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-08-05 13:45:41 +00:00
Filip Skokan
700a965dc3
crypto: prepare webcrypto key import/export for modern algorithms
PR-URL: https://github.com/nodejs/node/pull/59284
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-08-05 13:25:29 +00:00
Alex Yang
9bcc5a8f01
domain: remove deprecated API call
PR-URL: https://github.com/nodejs/node/pull/59339
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
2025-08-05 03:51:16 +00:00
lluisemper
b8e643259e
zlib: add dictionary support to zstdCompress and zstdDecompress
Adds optional dictionary support to zlib’s zstdCompress and
zstdDecompress APIs. This enables better compression ratios when the
dictionary matches expected input structure or content patterns.

The implementation allows passing a `dictionary` buffer through the
options object. Support was added to both streaming and convenience
methods. Tests and documentation were also updated to reflect this new
capability.

Fixes: https://github.com/nodejs/node/issues/59105
PR-URL: https://github.com/nodejs/node/pull/59240
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2025-08-04 16:13:57 +00:00
Haram Jeong
f7c2a7ed4a
http: add server.keepAliveTimeoutBuffer option
PR-URL: https://github.com/nodejs/node/pull/59243
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
2025-08-04 13:47:09 +00:00
Rafael Gonzaga
55b7d2890d
lib: handle superscript variants on windows device
Windows recognizes the 8-bit [ISO/IEC 8859-1](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
superscript digits ¹, ², and ³ as digits and treats them as
valid parts of COM# and LPT# device names, making them reserved
in every directory.

Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/59261
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-08-02 17:39:16 +00:00
hotpineapple
824c0715bf
lib: use validateString
refactor validation code using validate function

PR-URL: https://github.com/nodejs/node/pull/59296
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2025-08-02 11:31:47 +00:00
Chengzhong Wu
f33e0fcc83
lib: add type names in source mapped stack traces
The type name is determined by the constructor name of the receiver in a
call site.

PR-URL: https://github.com/nodejs/node/pull/58976
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-08-01 17:11:57 +00:00
Sylphy-0xd3ac
5794e644b7 fs: fix glob TypeError on restricted dirs
When a directory cannot be read due to permission issues, the async
version of fs.glob() returns null from readdir(), while the sync
version returns an empty array. This causes a TypeError when trying
to access the 'length' property of null.

PR-URL: https://github.com/nodejs/node/pull/58674
Fixes: https://github.com/nodejs/node/issues/58670
Fixes: https://github.com/nodejs/node/issues/58276
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan-Arrowood <ethan@arrowood.dev>
Reviewed-By: Juan José <soyjuanarbol@gmail.com>
2025-08-01 07:25:18 -07:00
Antoine du Hamel
5ebfb99a96
worker: implements nits in Web Locks code
PR-URL: https://github.com/nodejs/node/pull/59270
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2025-07-31 08:14:57 +00:00
Sebastian Beltran
91dadf2897
http: deprecate writeHeader
PR-URL: https://github.com/nodejs/node/pull/59060
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-07-29 23:12:48 +00:00
René
eabb75cea8
lib: prefer AsyncIteratorPrototype primordial
PR-URL: https://github.com/nodejs/node/pull/59097
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2025-07-29 21:54:16 +00:00
Alex Yang
a93da0a329
fs: correct error message when FileHandle is transferred
PR-URL: https://github.com/nodejs/node/pull/59156
Fixes: https://github.com/nodejs/node/issues/59155
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2025-07-29 19:28:35 +00:00
Darshan Sen
751203d36b
http2: set Http2Stream#sentHeaders for raw headers
When https://github.com/nodejs/node/pull/57917 added support for sending
raw header arrays, Http2Stream#sentHeaders was set only for header
objects. This change also sets it for raw headers by lazily
instantiating the property to avoid any performance impact on the fast
path.

Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/59244
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-07-29 14:44:52 +00:00
Alex Yang
f904fa77f8
test_runner: remove unused callee convertion
PR-URL: https://github.com/nodejs/node/pull/59221
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-07-29 00:21:37 -07:00
James M Snell
5335c101a9 fs: port SonicBoom module to fs module as Utf8Stream
As a first step to porting portions of the pino structured
logger into the runtime, this commit ports the SonicBoom
module to the fs module as Utf8Stream.

This is a faithful port of the SonicBoom module with some
modern updates, such as converting to a Class and using
Symbol.dispose. The bulk of the implementation is unchanged
from the original.

PR-URL: https://github.com/nodejs/node/pull/58897
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
2025-07-28 20:27:07 -07:00
theanarkh
0ba6e0d7ce
worker: add cpuUsage for worker
PR-URL: https://github.com/nodejs/node/pull/59177
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com>
2025-07-28 10:42:44 +00:00
Joyee Cheung
0259df9faf
cli: add --use-env-proxy
This does the same as NODE_USE_ENV_PROXY. When both are set,
like other options that can be configured from both sides,
the CLI flag takes precedence.

PR-URL: https://github.com/nodejs/node/pull/59151
Fixes: https://github.com/nodejs/node/issues/59100
Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-07-26 20:43:10 +00:00
Joyee Cheung
6ea421a3d3
module: fix conditions override in synchronous resolve hooks
1. Make sure that the conditions are converted into arrays when
  being passed into user hooks.
2. Pass the conditions from user hooks into the ESM resolution
  so that it takes effect.

PR-URL: https://github.com/nodejs/node/pull/59011
Fixes: https://github.com/nodejs/node/issues/59003
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
2025-07-26 09:13:11 +00:00
Allon Murienik
a480d998d9
process: make execve's args argument optional
Align the code with the documentation and similar methods used to
execute os commands - the `args` argument should be optional, and if
omitted, treated as an empty array (`[]`).

Fixes: https://github.com/nodejs/node/issues/58411
PR-URL: https://github.com/nodejs/node/pull/58412
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2025-07-26 02:35:57 +00:00
Alex Yang
58b5dc3eb2
util: respect nested formats in styleText
Co-authored-by: Jordan Harband <ljharb@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/59098
Fixes: https://github.com/nodejs/node/issues/59035
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2025-07-23 19:33:51 +00:00
Guy Bedford
0df15188d7 esm: unflag --experimental-wasm-modules
PR-URL: https://github.com/nodejs/node/pull/57038
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-07-22 13:24:06 -07:00
René
fb6d6aa3bb
perf_hooks: do not expose SafeMap via Histogram wrapper
PR-URL: https://github.com/nodejs/node/pull/59094
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-07-22 16:28:02 +00:00
Ilyas Shabi
2a7fb0a680
src: add cache to nearest parent package json
PR-URL: https://github.com/nodejs/node/pull/59086
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-07-21 15:26:02 +00:00