Commit Graph

5435 Commits

Author SHA1 Message Date
Joyee Cheung
3e31baeda6
esm: use sync loading/resolving on non-loader-hook thread
ESM resolution and loading is now always synchronous from a
non-loader-hook thread. If no asynchrnous loader hooks are
registered, the resolution/loading is entirely synchronous.
If asynchronous loader hooks are registered, these would be
synchronous on the non-loader-hook thread, and asynchronous
on the loader hook thread.

This avoids several races caused by async/sync loading sharing
the same cache. In particular, asynchronous loader hooks
now works with `require(esm)` - previously it tends to break
due to races.

In addition, when an asynchronous loader hook
returns a promise that never settles, the main thread no longer
silently exits with exit code 13, leaving the code below
any module loading calls silently ignored without being executed.
Instead, it now throws ERR_ASYNC_LOADER_REQUEST_NEVER_SETTLED
which can be caught and handled by the main thread. If the module
request comes from `import()`, the never-settling promise is
now relayed to the result returned by `import()`.

Drive-by: when annotating the error about importing undetectable
named exports from CommonJS, it now no longer reload the source
code of the CommonJS module, and instead reuses format information
cached when the module was loaded for linking.

PR-URL: https://github.com/nodejs/node/pull/60380
Fixes: https://github.com/nodejs/node/issues/59666
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
2025-10-31 20:45:10 +00:00
René
2fb3c7eef5
lib: throw from localStorage getter on missing storage path
PR-URL: https://github.com/nodejs/node/pull/60351
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
2025-10-31 19:48:29 +00:00
Ge Gao
fbef1cf438
util: fix stylize of special properties in inspect
Previously, formatExtraProperties applied ctx.stylize to the entire
'[key]: value' string. This caused the colon and space to be styled,
making the output inconsistent with normal object properties.

Now, only the key itself is stylized, and the colon and space remain
unstyled, aligning with the formatting of regular properties.

Refs: https://github.com/nodejs/node/pull/60131
PR-URL: https://github.com/nodejs/node/pull/60479
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-10-31 08:33:38 +00:00
btea
bdf03bfcd5
http: replace startsWith with strict equality
PR-URL: https://github.com/nodejs/node/pull/59394
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2025-10-30 14:43:31 +00:00
Robert Nagy
3dba25fbd2
stream: don't try to read more if reading
Avoid unnecessary nextTick.

PR-URL: https://github.com/nodejs/node/pull/60454
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-10-30 08:55:51 +00:00
Joyee Cheung
1f6b681bf2 src: fix timing of snapshot serialize callback
Previously the addAfterUserSerailizeCallback() wasn't
ready to be used for building the built-in snapshot.
This patch initializes the callbacks at the time
lib/internal/v8/start_snapshot.js is loaded, so that
these callbacks get run correctly when building the
built-in snapshot.

Currently when building the built-in snapshot,
addAfterUserSerializeCallback() is only used by createUnsafeBuffer(),
other usages can only come from user-land snapshots,
which is covered by tests, but what gets run by the
built-in snapshot building process is less visible, and the
path used by createUnsafeBuffer() isn't reliably visible in user
land either. This adds an internal usage counter in debug builds
to verify this path when building the built-in snapshot.

PR-URL: https://github.com/nodejs/node/pull/60434
Fixes: https://github.com/nodejs/node/issues/60423
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2025-10-28 00:15:55 +00:00
avcribl
4fe325d93d
stream: preserve AsyncLocalStorage on finished only when needed
PR-URL: https://github.com/nodejs/node/pull/59873
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-10-27 19:23:34 +00:00
SeokHun
d9cf867a9d
lib: fix typo in createBlobReaderStream
Corrects the misspelling of "proecss" to "process".

PR-URL: https://github.com/nodejs/node/pull/60132
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-10-27 14:14:15 +00:00
Shelley Vohr
fb84f35fec
tls: avoid external memory leak on invalid protocol versions
PR-URL: https://github.com/nodejs/node/pull/60390
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-10-26 16:29:49 +00:00
Yagiz Nizipli
ddbe1365ff
util: reduce TextEncoder.encodeInto function size
PR-URL: https://github.com/nodejs/node/pull/60339
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-10-23 14:38:22 +00:00
Joyee Cheung
b19525a33c
module: refactor and clarify async loader hook customizations
- This updates the comments that assume loader hooks must be async
- Differentiate the sync/async loader hook paths in naming
  `#customizations` is now `#asyncLoaderHooks` to make it clear
  it's from the async APIs.
- Differentiate the paths running on the loader hook thread
  (affects the loading of async other loader hooks and are async)
  v.s. paths on the main thread calling out to code on the loader
  hook thread (do not handle loading of other async loader hooks, and
  can be sync by blocking).
  - `Hooks` is now `AsyncLoaderHooksOnLoaderHookWorker`
  - `CustomizedModuleLoader` is now
    `AsyncLoaderHooksProxiedToLoaderHookWorker` and moved into
    `lib/internal/modules/esm/hooks.js` as it implements the same
    interface as `AsyncLoaderHooksOnLoaderHookWorker`
  - `HooksProxy` is now `AsyncLoaderHookWorker`
  - Adjust the JSDoc accordingly
- Clarify the "loader worker" as the "async loader hook worker"
  i.e. when there's no _async_ loader hook registered, there won't
  be this worker, to avoid the misconception that this worker
  is spawned unconditionally.
- The code run on the loader hook worker to process
  `--experimental-loader` is moved into
  `lib/internal/modules/esm/worker.js` for clarity.
- The initialization configuration `forceDefaultLoader` is split
  into `shouldSpawnLoaderHookWorker` and `shouldPreloadModules`
  as those can be separate.
- `--experimental-vm-modules` is now processed during pre-execution
  and no longer part of the initialization of the built-in ESM
  loader, as it only exposes the vm APIs of ESM, and is unrelated
  to built-in ESM loading.

PR-URL: https://github.com/nodejs/node/pull/60278
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2025-10-23 13:42:23 +00:00
Joyee Cheung
f46d501b7f
test_runner: use module.registerHooks in module mocks
Migrate away from module.register(). This no longer needs to
deal with the worker synchronization.

PR-URL: https://github.com/nodejs/node/pull/60326
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2025-10-22 11:05:39 +00:00
Antoine du Hamel
2fb82c8c28
util: use more defensive code when inspecting error objects
PR-URL: https://github.com/nodejs/node/pull/60139
Fixes: https://github.com/nodejs/node/issues/60107
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-10-20 18:14:39 +00:00
Marco Ippolito
cec1bd5498
src: add watch config namespace
PR-URL: https://github.com/nodejs/node/pull/60178
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-10-20 13:53:29 +02:00
Ruben Bridgewater
70e7c1511f
util: mark special properties when inspecting them
This makes sure special properties (such as a byteLength, buffer,
and more) are marked that they are not regular properties. They
are mostly getters, that just seemed even more of a breaking change.
Thus, they just use square brackets for now.

On top of that, it makes inspecting detached DataViews robust.
Inspecting those failed so far.

PR-URL: https://github.com/nodejs/node/pull/60131
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-10-18 21:29:35 +02:00
Joyee Cheung
38bf955937 vm: make vm.Module.evaluate() conditionally synchronous
- Make sure that the vm.Module.evaluate() method is conditionally
  synchronous based on the specification. Previously, the returned
  promise is unconditionally pending (even for synthetic modules and
  source text modules without top-level await) instead of immediately
  fulfilled, making it harder to debug as it deviates from the
  specified behavior.
- Clarify the synchronicity of this method in the documentation
- Add more tests for the synchronicity of this method.

PR-URL: https://github.com/nodejs/node/pull/60205
Refs: https://github.com/nodejs/node/issues/59656
Refs: https://github.com/nodejs/node/issues/37648
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-10-18 08:20:47 +00:00
Ruben Bridgewater
d3f79aa65d
assert: allow printf-style messages as assertion error
Also add functions as allowed message input.
This allows to have leavy message computation to become cheaper.

PR-URL: https://github.com/nodejs/node/pull/58849
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-10-17 20:15:17 +00:00
Joyee Cheung
170848bc18
module: handle null source from async loader hooks in sync hooks
This relaxes the validation in sync hooks so that it accepts
the quirky nullish source returned by the default step of the
async loader when the module being loaded is CommonJS.
When there are no customization hooks registered, a saner
synchronous default load step is used to use a property
instead of a reset nullish source to signify that the module
should go through the CJS monkey patching routes and reduce
excessive reloading from disk.

PR-URL: https://github.com/nodejs/node/pull/59929
Fixes: https://github.com/nodejs/node/issues/59384
Fixes: https://github.com/nodejs/node/issues/57327
Refs: https://github.com/nodejs/node/issues/59666
Refs: https://github.com/dygabo/load_module_test
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
2025-10-14 16:28:22 +00:00
Shima Ryuhei
1072295d26
inspector: support handshake response for websocket inspection
PR-URL: https://github.com/nodejs/node/pull/60225
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2025-10-14 07:06:15 +00:00
Tobias Nießen
5cf3c3e24c
http2: rename variable to additionalPseudoHeaders
PR-URL: https://github.com/nodejs/node/pull/60208
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
2025-10-13 08:31:02 +00:00
Antoine du Hamel
822a8c3244
perf_hooks: fix stack overflow error
PR-URL: https://github.com/nodejs/node/pull/60084
Fixes: https://github.com/nodejs/node/issues/54768
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2025-10-13 10:05:45 +02:00
SeokHun
4daeec11b9
lib: fix typo in QuicSessionStats
Corrects the misspelling of "privateSynbol" to "privateSymbol".

PR-URL: https://github.com/nodejs/node/pull/60155
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-10-10 04:16:56 +00:00
Joyee Cheung
db0121bedd
module: fix directory option in the enableCompileCache() API
The option name should be `directory` to be consistent with the
returned result. It should also allow environment variable
overrides.

This also adds documentation for the new options and improves it.

PR-URL: https://github.com/nodejs/node/pull/59931
Reviewed-By: Aditi Singh <aditisingh1400@gmail.com>
2025-10-09 07:55:31 +00:00
Moshe Atlow
6dbf7086bb
test_runner: fix suite timeout
PR-URL: https://github.com/nodejs/node/pull/59853
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-10-09 04:40:05 +00:00
René
535efea962
http2: do not crash on mismatched ping buffer length
PR-URL: https://github.com/nodejs/node/pull/60135
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-10-08 23:23:34 +00:00
sangwook
f0aa073907 test_runner: add junit file attribute support
Add file attribute to JUnit testcase elements when file information
is available in test event data.

PR-URL: https://github.com/nodejs/node/pull/59432
Fixes: https://github.com/nodejs/node/issues/59422
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
2025-10-08 12:27:36 +00:00
Gürgün Dayıoğlu
15278252bb
lib: remove redundant destroyHook checks
PR-URL: https://github.com/nodejs/node/pull/60120
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2025-10-08 12:11:43 +00:00
Dario Piotrowicz
200fe9e7f4
repl: move completion logic to internal module
PR-URL: https://github.com/nodejs/node/pull/59889
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-10-08 07:37:22 +00:00
James M Snell
d52cd04591
quic: continue working on quic api bits
PR-URL: https://github.com/nodejs/node/pull/60123
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2025-10-07 14:04:53 +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
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
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
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
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
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
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
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
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
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