Commit Graph

12058 Commits

Author SHA1 Message Date
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
Shima Ryuhei
c8d5b394e4
repl: handle errors from getters during completion
PR-URL: https://github.com/nodejs/node/pull/59044
Reviewed-By: Dario Piotrowicz <dario.piotrowicz@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-07-19 12:32:19 +00:00
Guy Bedford
35e599b3d0 esm: js-string Wasm builtins in ESM Integration
PR-URL: https://github.com/nodejs/node/pull/59020
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-07-18 15:50:52 -07:00
Joyee Cheung
edd66d0130
crypto: add tls.setDefaultCACertificates()
This API allows dynamically configuring CA certificates that
will be used by the Node.js TLS clients by default.

Once called, the provided certificates will become the default CA
certificate list returned by `tls.getCACertificates('default')` and
used by TLS connections that don't specify their own CA certificates.

This function only affects the current Node.js thread.

PR-URL: https://github.com/nodejs/node/pull/58822
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-07-18 19:57:53 +00:00
ishabi
062e8b5a74 worker: add web locks api
PR-URL: https://github.com/nodejs/node/pull/58666
Fixes: https://github.com/nodejs/node/pull/36502
Refs: https://w3c.github.io/web-locks
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2025-07-18 07:55:10 -07:00
Yagiz Nizipli
0fd1ecded6
meta: enable jsdoc/check-tag-names rule
PR-URL: https://github.com/nodejs/node/pull/58521
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-07-18 09:28:21 +00:00
Joyee Cheung
036b1fd66d
http,https: add built-in proxy support in http/https.request and Agent
This patch implements proxy support for HTTP and HTTPS clients and
agents in the `http` and `https` built-ins`. When NODE_USE_ENV_PROXY
is set to 1, the default global agent would parse the
HTTP_PROXY/http_proxy, HTTPS_PROXY/https_proxy, NO_PROXY/no_proxy
settings from the environment variables, and proxy the requests
sent through the built-in http/https client accordingly.

To support this, `http.Agent` and `https.Agent` now accept a few new
options:

- `proxyEnv`: when it's an object, the agent would read and parse
  the HTTP_PROXY/http_proxy, HTTPS_PROXY/https_proxy, NO_PROXY/no_proxy
  properties from it, and apply them based on the protocol it uses
  to send requests. This option allows custom agents to
  reuse built-in proxy support by composing options. Global agents
  set this to `process.env` when NODE_USE_ENV_PROXY is 1.
- `defaultPort` and `protocol`: these allow setting of the default port
  and protocol of the agents. We also need these when configuring
  proxy settings and deciding whether a request should be proxied.

Implementation-wise, this adds a `ProxyConfig` internal class to handle
parsing and application of proxy configurations. The configuration
is parsed during agent construction. When requests are made,
the `createConnection()` methods on the agents would check whether
the request should be proxied. If yes, they either connect to the
proxy server (in the case of HTTP reqeusts) or establish a tunnel
(in the case of HTTPS requests) through either a TCP socket (if the
proxy uses HTTP) or a TLS socket (if the proxy uses HTTPS).

When proxying HTTPS requests through a tunnel, the connection listener
is invoked after the tunnel is established. Tunnel establishment uses
the timeout of the request options, if there is one. Otherwise it uses
the timeout of the agent.

If an error is encountered during tunnel establishment, an
ERR_PROXY_TUNNEL would be emitted on the returned socket. If the proxy
server sends a errored status code, the error would contain an
`statusCode` property. If the error is caused by timeout, the error
would contain a `proxyTunnelTimeout` property.

This implementation honors the built-in socket pool and socket limits.
Pooled sockets are still keyed by request endpoints, they are just
connected to the proxy server instead, and the persistence of the
connection can be maintained as long as the proxy server respects
connection/proxy-connection or persist by default (HTTP/1.1)

PR-URL: https://github.com/nodejs/node/pull/58980
Refs: https://github.com/nodejs/node/issues/57872
Refs: https://github.com/nodejs/node/issues/8381
Refs: https://github.com/nodejs/node/issues/15620
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-07-18 09:06:32 +02:00
RafaelGSS
a8e4e0613c
lib: handle all windows reserved driver name
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs-private/node-private/pull/721
Refs: https://hackerone.com/reports/3160912
CVE-ID: CVE-2025-27210
2025-07-15 19:29:25 -03:00
Dario Piotrowicz
049664bbdc
repl: fix repl crashing on variable declarations without init
PR-URL: https://github.com/nodejs/node/pull/59032
Fixes: https://github.com/nodejs/node/issues/59029
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-07-11 16:43:10 +00:00
Filip Skokan
a472745958
crypto: runtime-deprecate default shake128/256 output lengths
PR-URL: https://github.com/nodejs/node/pull/59008
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-07-11 14:21:46 +00:00
René
e3e739de63
test_runner: clean up promisified interval generation
* yield from loop instead of setting up custom iterator
* cancel abort listener on exit
* do not call <Array>.at(0)

PR-URL: https://github.com/nodejs/node/pull/58824
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2025-07-10 20:15:31 +00:00
theanarkh
c44fa8d0b6
dns: support max timeout
PR-URL: https://github.com/nodejs/node/pull/58440
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-07-10 15:50:43 +00:00
Shima Ryuhei
b7db89f491
inspector: initial support for Network.loadNetworkResource
Fixes: https://github.com/nodejs/node/issues/57873
PR-URL: https://github.com/nodejs/node/pull/58077
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-07-10 12:34:11 +00:00
Dario Piotrowicz
69453378fc
repl: improve REPL disabling completion on proxies and getters
https://github.com/nodejs/node/pull/57909 introduced the disabling
of REPL tab completion on object containing proxies and getters
(since such completion triggers code evaluation which can be
unexpected/disruptive for the user)

the solution in 57909 did not address all possible such cases,
the changes here improve on such solution by using acorn and
AST analysis to cover most if not all possible cases

PR-URL: https://github.com/nodejs/node/pull/58891
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-07-09 20:52:25 +00:00
Joyee Cheung
793a2792d5
module: throw error when re-runing errored module jobs
Re-evaluating an errored ESM should lead to rejecting
the rejection again - this is also the case when importing
it twice. In the case of retrying with
require after import, just throw the cached error.

Drive-by: add some debug logs.
PR-URL: https://github.com/nodejs/node/pull/58957
Fixes: https://github.com/nodejs/node/issues/58945
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-07-09 16:39:29 +00:00
alphaleadership
4de0197441
net: update net.blocklist to allow file save and file management
PR-URL: https://github.com/nodejs/node/pull/58087
Fixes: https://github.com/nodejs/node/issues/56252
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-07-08 20:37:51 +00:00
Rafael Gonzaga
eff504ff12
lib: flag to conditionally modify proto on deprecate
Refs: https://github.com/nodejs/node/issues/58218
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/58928
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2025-07-08 18:54:46 +00:00
Aditi
1c4fe6d795
crypto: support outputLength option in crypto.hash for XOF functions
Support `outputLength` option in crypto.hash() for XOF hash
functions to align with the behaviour of crypto.createHash()
API

closes: https://github.com/nodejs/node/issues/57312

Co-authored-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/58121
Fixes: https://github.com/nodejs/node/issues/57312
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-07-08 13:39:00 +00:00
Chengzhong Wu
ba49d71dbf
inspector: support undici traffic data inspection
Support undici sent and received data inspection in Chrome DevTools.

PR-URL: https://github.com/nodejs/node/pull/58953
Reviewed-By: Ryuhei Shima <shimaryuhei@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2025-07-07 21:25:34 +00:00
toyobayashi
8cc5e57af3 lib: expose setupInstance method on WASI class
PR-URL: https://github.com/nodejs/node/pull/57214
Reviewed-By: Guy Bedford <guybedford@gmail.com>
2025-07-07 08:41:16 -07:00
Kevin Gibbons
9523c84c17 fs: add disposable mkdtempSync
PR-URL: https://github.com/nodejs/node/pull/58516
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2025-07-07 06:44:07 -07:00
Livia Medeiros
9ab976397d
fs: close dir before throwing if options.bufferSize is invalid
PR-URL: https://github.com/nodejs/node/pull/58856
Fixes: https://github.com/nodejs/node/issues/58854
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2025-07-06 05:32:45 +00:00
Filip Skokan
f5da8f89ee
crypto: fix SHAKE128/256 breaking change introduced with OpenSSL 3.4
Reverts: https://github.com/nodejs/node/pull/56160
Fixes: https://github.com/nodejs/node/issues/56159
Fixes: https://github.com/nodejs/node/issues/58913
Refs: https://github.com/nodejs/node/pull/58121
PR-URL: https://github.com/nodejs/node/pull/58942
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-07-05 09:34:24 +00:00
Joyee Cheung
053467253d
bootstrap: initialize http proxy after user module loader setup
The externalized undici relies on the user module loader, so
in the externalized build, initialization of http proxy which
relies on undici needs to be deferred until after the user module
loader is initialized.

PR-URL: https://github.com/nodejs/node/pull/58938
Refs: https://github.com/nodejs/node/issues/58865
Refs: https://github.com/nodejs/node/issues/57872
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-07-05 01:10:38 +00:00
Chengzhong Wu
cc856b3d5d
module: link module with a module request record
When a module is being statically linked with module requests, if two
module requests with a same specifier but different attributes are
resolved to two modules, the module requests should be linked to these
two modules.

PR-URL: https://github.com/nodejs/node/pull/58886
Refs: https://tc39.es/ecma262/#sec-HostLoadImportedModule
Refs: https://github.com/tc39/proposal-import-attributes?tab=readme-ov-file#how-would-this-proposal-work-with-caching
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-07-04 19:56:08 +00:00
Rafael Gonzaga
8173d9d72b
permission: propagate permission model flags on spawn
Previously, only child_process.fork propagated the exec
arguments (execvArgs) to the child process.
This commit adds support for spawn and spawnSync to
propagate permission model flags — except when they are
already provided explicitly via arguments or through
NODE_OPTIONS.

Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/58853
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2025-07-02 02:32:20 +00:00
Ruben Bridgewater
c08a1d152b
v8: fix missing callback in heap utils destroy
This fixes the v8.getHeapSnapshot() calls not properly being
destroyed. Pipeline calls would for example not properly end
without the callback being in place.

PR-URL: https://github.com/nodejs/node/pull/58846
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
2025-06-30 11:51:40 +00:00
Yoshiya Hinosawa
7db30d7ca8
assert: remove dead code
PR-URL: https://github.com/nodejs/node/pull/58760
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-06-29 21:39:04 +00:00
Pietro Marchini
61a0b12c80
test_runner: correctly filter --experimental-config-file
PR-URL: https://github.com/nodejs/node/pull/58833
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-06-29 20:48:29 +00:00
James M Snell
a3dfca90d1 process: move multipleResolves event to EOL
The `multipleResolves` event has been deprecated for several
years now. It's time.

PR-URL: https://github.com/nodejs/node/pull/58707
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2025-06-29 04:23:09 -07:00
Dario Piotrowicz
529967aa95 watch: add --watch-kill-signal flag
add the new `--watch-kill-signal` to allow users to customize
what signal is sent to the process on restarts during watch mode

PR-URL: https://github.com/nodejs/node/pull/58719
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-06-28 22:51:59 +00:00
Chengzhong Wu
0f7e75f7f6
vm: expose import phase on SourceTextModule.moduleRequests
PR-URL: https://github.com/nodejs/node/pull/58829
Refs: https://github.com/nodejs/node/issues/37648
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-06-28 18:51:48 +00:00
Dario Piotrowicz
9fe3316280
repl: fix eval errors thrown after close throwing ERR_USE_AFTER_CLOSE
prevent incorrect throws of `ERR_USE_AFTER_CLOSE` errors when the eval
function of a repl server returns an error after the repl server
has been closed

PR-URL: https://github.com/nodejs/node/pull/58791
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2025-06-28 18:51:41 +00:00
Livia Medeiros
d824914e61
fs: throw ERR_INVALID_THIS on illegal invocations
PR-URL: https://github.com/nodejs/node/pull/58848
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-06-28 16:58:54 +00:00
Antoine du Hamel
afbf2f385a
tty: treat empty NO_COLOR same as absent NO_COLOR
PR-URL: https://github.com/nodejs/node/pull/58074
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-06-28 15:26:22 +02:00
jesh
eaebfab299
doc: fix jsdoc definition of assert.ifError() fn in lib/assert.js
PR-URL: https://github.com/nodejs/node/pull/58573
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-06-27 13:30:51 +00:00
jakecastelli
94f7568e5c
test_runner: fix timeout not propagated to the child process in run
PR-URL: https://github.com/nodejs/node/pull/58831
Fixes: https://github.com/nodejs/node/issues/58802
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Adrian Estrada <edsadr@gmail.com>
2025-06-27 11:50:17 +00:00
Jacob Smith
5b0c7dba0e
test_runner: correct "already mocked" error punctuation placement
PR-URL: https://github.com/nodejs/node/pull/58840
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-06-26 20:01:15 +00:00
沈鸿飞
b4c5fb4ffb
lib: fix getTypeScriptParsingMode jsdoc
PR-URL: https://github.com/nodejs/node/pull/58681
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-06-26 07:04:40 +00:00
Dario Piotrowicz
8ba66c5e7b
repl: improve tab completion on computed properties
improve the tab completion capabilities around computed properties
by replacing the use of brittle and error prone Regex checks with
more robust AST based analysis

PR-URL: https://github.com/nodejs/node/pull/58775
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-06-26 01:50:46 +00:00
Alex Yang
a705e240b1
module: convert schema-only core module on convertCJSFilenameToURL
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/58612
Fixes: https://github.com/nodejs/node/issues/58607
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-06-25 16:49:56 +00:00
Mert Can Altin
6ce6fdbf21
module: update tests for combined ambiguous module syntax error
PR-URL: https://github.com/nodejs/node/pull/55874
Fixes: https://github.com/nodejs/node/issues/55776
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-06-24 21:49:31 +00:00
cjihrig
dff081e01f
test_runner: automatically wait for subtests to finish
This commit updates the test runner to automatically wait for
subtests to finish. This makes the experience more consistent
with suites and removes the need to await anything.

PR-URL: https://github.com/nodejs/node/pull/58800
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-06-24 11:02:46 -03:00
Shima Ryuhei
057b4b5d30
http: fix keep-alive not timing out after post-request empty line
Fixes: https://github.com/nodejs/node/issues/58140
PR-URL: https://github.com/nodejs/node/pull/58178
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-06-24 12:37:20 +00:00
LiviaMedeiros
6145ba7c75 lib: rename validateInternalField into validateThisInternalField
PR-URL: https://github.com/nodejs/node/pull/58765
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-06-24 04:39:36 +01:00
LiviaMedeiros
68930cf550 lib: make validateInternalField() throw ERR_INVALID_THIS
PR-URL: https://github.com/nodejs/node/pull/58765
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-06-24 04:39:35 +01:00
Romain Menke
bf86e025a5 Revert "test_runner: remove promises returned by t.test()"
This reverts commit 1a2eb15bc6.

PR-URL: https://github.com/nodejs/node/pull/58282
Fixes: https://github.com/nodejs/node/issues/58227
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2025-06-23 09:37:40 +00:00
Romain Menke
9a1c0bc07a Revert "test_runner: remove promises returned by test()"
This reverts commit 96718268fe.

PR-URL: https://github.com/nodejs/node/pull/58282
Fixes: https://github.com/nodejs/node/issues/58227
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2025-06-23 09:37:40 +00:00
Romain Menke
7a0c74b4ea Revert "test_runner: automatically wait for subtests to finish"
This reverts commit aa3523ec22.

PR-URL: https://github.com/nodejs/node/pull/58282
Fixes: https://github.com/nodejs/node/issues/58227
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2025-06-23 09:37:39 +00:00
baki gul
dcfdaab13a
repl: avoid deprecated require.extensions in tab completion
PR-URL: https://github.com/nodejs/node/pull/58653
Fixes: https://github.com/nodejs/node/issues/58641
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Dario Piotrowicz <dario.piotrowicz@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-06-23 06:21:47 +00:00
James M Snell
eec0302088
fs: move rmdir recursive option to end-of-life
Has been runtime deprecated for ~ 5 years now. It's time.

PR-URL: https://github.com/nodejs/node/pull/58616
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Dario Piotrowicz <dario.piotrowicz@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-06-21 16:20:38 +00:00
Chengzhong Wu
e679e38b25 lib: make domexception a native error
Co-Authored-By: Kenta Moriuchi <moriken@kimamass.com>
PR-URL: https://github.com/nodejs/node/pull/58691
Fixes: https://github.com/nodejs/node/issues/56497
Refs: e3df60f3f5
Refs: https://github.com/nodejs/node/pull/58138
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-06-21 10:43:37 +00:00
Ruben Bridgewater
11222f1a27
assert,util: handle invalid dates as equal in deep comparison
Invalid dates are now handled as equal in all deep comparisons.

PR-URL: https://github.com/nodejs/node/pull/57627
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-06-21 04:00:23 +00:00
James M Snell
c3b986853c crypto: move deprecated hash and mgf1Hash options to EOL
Runtime deprecation for ~3 years.

PR-URL: https://github.com/nodejs/node/pull/58706
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-06-20 13:09:06 -07:00
René
ce546e468a
fs: make Dir disposers idempotent
PR-URL: https://github.com/nodejs/node/pull/58692
Refs: https://github.com/nodejs/node/pull/58206
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-06-20 19:03:34 +00:00
Chengzhong Wu
5a14ea62b9
inspector: add protocol methods retrieving sent/received data
Add protocol method `Network.dataSent` to buffer request data. And
expose protocol methods `Network.getRequestPostData` and
`Network.getResponseBody` allowing devtool to retrieve buffered data.

PR-URL: https://github.com/nodejs/node/pull/58645
Reviewed-By: Ryuhei Shima <shimaryuhei@gmail.com>
2025-06-20 10:20:37 +00:00
Livia Medeiros
f2e99c5c16
fs: avoid computing time coefficient constants in runtime
PR-URL: https://github.com/nodejs/node/pull/58728
Fixes: https://github.com/nodejs/node/issues/58726
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-06-18 16:36:55 +00:00
LiviaMedeiros
5584cc5038
fs: remove IIFE in glob
PR-URL: https://github.com/nodejs/node/pull/58418
Refs: https://github.com/nodejs/node/issues/58419
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-06-18 05:19:57 +08:00
Renegade334
ef2e0848ba
test_runner: prefer Atomics primordials
PR-URL: https://github.com/nodejs/node/pull/58716
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-06-17 16:53:58 +02:00
Rafael Gonzaga
462c74181d
src,permission: add --allow-net permission
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/58517
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2025-06-17 12:35:23 +00:00
Dario Piotrowicz
07220230d9
repl: fix tab completion not working with computer string properties
PR-URL: https://github.com/nodejs/node/pull/58709
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2025-06-17 00:39:15 +00:00
Sam Verschueren
ea5d37ecbe
util: inspect: do not crash on an Error stack pointing to itself
PR-URL: https://github.com/nodejs/node/pull/58196
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-06-16 23:36:47 +00:00
Dario Piotrowicz
d6dade5bc5
test: add tests for REPL custom evals
this commit reintroduces the REPL custom eval tests that have
been introduced in https://github.com/nodejs/node/pull/57691
but reverted in https://github.com/nodejs/node/pull/57793

the tests turned out problematic before because `getReplOutput`,
the function used to return the repl output wasn't taking into
account that input processing and output emitting are asynchronous
operation can resolve with a small delay

the new implementation here replaces `getReplOutput` with
`getReplRunOutput` that resolves repl inputs by running them
and using the repl prompt as an indicator to when the input
processing has completed

PR-URL: https://github.com/nodejs/node/pull/57850
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2025-06-15 16:36:13 +00:00
James M Snell
3f6ad56846 url: add fileURLToPathBuffer API
The existing `fileURLToPath()` does not handle the case
where the input URL contains percent-encoded characters
that are not valid UTF-8 sequences. This can lead to
issues, for instance, when the URL is constructed
using file names in non-Unicode encodings (like
Shift-JIS). This commit introduces a new API,
`fileURLToPathBuffer()`, which returns a `Buffer`
representing the path, allowing for accurate
conversion of file URLs to paths without attempting
to decode the percent-encoded bytes into characters.

PR-URL: https://github.com/nodejs/node/pull/58700
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2025-06-14 14:06:04 -07:00
Livia Medeiros
823ca6991f
fs: make processReadResult() and readSyncRecursive() private
PR-URL: https://github.com/nodejs/node/pull/58672
Fixes: https://github.com/nodejs/node/issues/58671
Refs: https://github.com/nodejs/node/pull/41439
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2025-06-14 17:23:47 +00:00
James M Snell
a5f9ca1f77
dns: move falsy hostname in lookup to end-of-life
It's been deprecated for ~7 years. It's time.

PR-URL: https://github.com/nodejs/node/pull/58619
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2025-06-13 12:47:23 +00:00