Commit Graph
49851 Commits
Author SHA1 Message Date
Alexandre Zollinger Chohfi 7dc685b002 build: delay-load rarely used system DLLs on Windows
node.exe imports crypt32, dbghelp, iphlpapi, ole32, shell32, userenv
and winmm, so every process loads them, and the DLLs they depend on,
at start-up. They are only needed by less common code paths such as
the system certificate store, network interface queries and
diagnostic reports.

Delay-load them so they are loaded on first use. On Windows 11 this
takes `node -e 0` from 35 to 26 loaded images and saves about 2.5 ms
per process.

Signed-off-by: Alexandre Zollinger Chohfi <alzollin@microsoft.com>
PR-URL: https://github.com/nodejs/node/pull/67098
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
2026-11-28 18:18:32 +00:00
Aditya Reddy 8b26c7d3d7 doc: point require.extensions users to customization hooks
Signed-off-by: Aditya Reddy <82123567+adityareddy-dev@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/67243
Fixes: https://github.com/nodejs/node/issues/32483
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-28 16:37:08 +00:00
Sebastian Beltran 984728738b http: add 'sendingHeaders' event for response header manipulation
Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/63996
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-28 16:16:37 +00:00
Gautier Ben Aïm 2c0d215eef doc: reflect vfs improvements in sea page
Signed-off-by: Gautier Ben Aïm <48261497+GauBen@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/67096
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-28 15:42:46 +00:00
Richie McColl 94ca0dc6da doc: add node:bench types to type map
`doc/api/bench.md` references `{BenchContext}` and
`{BenchmarksStream}`, but neither type was in the type map, so they
rendered as literal text instead of links.

Signed-off-by: Richie McColl <richie.mccoll@hotmail.co.uk>
PR-URL: https://github.com/nodejs/node/pull/67793
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-28 15:15:09 +00:00
Antoine du Hamel a706edc218 tools: fix lint-py with Ruff 0.17.4
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67792
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Beth Griggs <bethanyngriggs@gmail.com>
2026-11-28 14:43:14 +00:00
Livia Medeiros d3f854569b test: prefer tmpdir.resolve() over path.join(tmpdir.path, ...)
Signed-off-by: LiviaMedeiros <livia@cirno.name>
PR-URL: https://github.com/nodejs/node/pull/67784
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-11-28 08:29:15 +00:00
Livia Medeiros 43437c8a41 test: prefer tmpdir.resolve() over path.join(tmpdir.path, ...)
Signed-off-by: LiviaMedeiros <livia@cirno.name>
PR-URL: https://github.com/nodejs/node/pull/67785
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-28 08:29:03 +00:00
Livia Medeiros 77e63802ab benchmark: prefer tmpdir.resolve() over path.join(tmpdir.path, ...)
Signed-off-by: LiviaMedeiros <livia@cirno.name>
PR-URL: https://github.com/nodejs/node/pull/67787
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-28 08:28:51 +00:00
Ilyas Shabi abaee7dbad v8: add heap profiling setSampleInterval
Signed-off-by: ishabi <ilyasshabi94@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67626
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-28 06:24:11 +00:00
James M Snell c58ccfa617 src: share send handle setup in StreamBase write paths
StreamBase::WriteBuffer() and WriteString() duplicated the code that
creates a request object when needed and attaches the handle being sent
over an IPC pipe. Move it into a shared PrepareSendHandle() helper.

Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67496
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-11-27 16:26:41 -08:00
James M Snell 99655c9478 permission: share fast path for permission.has()
FastHas() duplicated the scope parsing in FastHasResource(). Move the
shared logic into FastHasImpl(), with FastHas() passing an empty
resource.

Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67496
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-11-27 16:26:41 -08:00
James M Snell 82c00f75ee report: look up exclusion options inside WriteNodeReport()
All three callers of report::WriteNodeReport() computed the
excludeNetwork and excludeEnv options the same way, falling back to the
process-wide defaults when there is no Environment. Do that once inside
WriteNodeReport() instead.

Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67496
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-11-27 16:26:41 -08:00
James M Snell f7f21dea49 module: share holder creation context lookup in import.meta getters
ImportMetaResolveLazyGetter() and PathHelpersLazyGetter() duplicated
the code that retrieves the creation context from the holder object.
Move it into a shared GetHolderCreationContext() helper.

Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67496
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-11-27 16:26:41 -08:00
James M Snell 117744381b module: add missing return in ImportMetaResolveLazyGetter
When the creation context of the import.meta object has no associated
Realm, the getter threw ERR_INVALID_INVOCATION but then fell through
and dereferenced the null Realm. Return after throwing, as the other
error paths in the getter already do.

Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67496
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-11-27 16:26:41 -08:00
James M Snell 99e188b3db src: share method template setup in util.cc
The SetMethod(), SetFastMethod(), SetMethodNoSideEffect(),
SetProtoMethod(), SetInstanceMethod(), and SetProto*Dispose() variants
each repeated the same function template construction, internalized
name string creation, and installation code, differing only in side
effect type, receiver signature, and target. Factor that into a small
set of internal helpers.

Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67496
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-11-27 16:26:41 -08:00
James M Snell 329095185b inspector: share required event parameter extraction
The network and DOM storage agents repeated the same pattern dozens of
times: read a property with an ObjectGet*() helper and throw a
"Missing <name> in event" TypeError if it was absent. Add
ObjectGetRequired() overloads that combine the two, move the duplicated
ThrowEventError() into inspector_object_utils, and use them throughout
both agents. Error messages are unchanged.

Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67496
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-11-27 16:26:41 -08:00
James M Snell bc29c86cdf src: share callback lookup between callback methods
DynamicLibrary::UnregisterCallback(), RefCallback(), and UnrefCallback()
each duplicated the closed-library check, pointer argument validation,
and callback map lookup. Move them into a shared FindCallback() helper.

Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67496
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-11-27 16:26:36 -08:00
James M Snell 561f101bc3 node-api: share error creation and throw helpers
napi_create_error(), napi_create_type_error(), napi_create_range_error()
and node_api_create_syntax_error() differed only in the v8::Exception
factory used, as did the corresponding napi_throw_*() functions. Move
the bodies into internal CreateError() and ThrowError() helpers that
take the factory. The exported functions and their signatures are
unchanged, so there is no ABI impact.

Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67496
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-11-27 16:26:36 -08:00
James M Snell b2d31d174b src: share x64 instruction emitters between SysV and Win64
The System V and Win64 halves of the x64 fast trampoline emitter each
defined identical copies of the register constants, the byte/word
emitters, the REX/ModRM, mov, call, jmp, stack adjustment, and ret
encoders, and the narrow return normalization helpers. Define them
once ahead of the ABI-specific code.

Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67496
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-11-27 16:26:29 -08:00
James M Snell d23dd9562c src: share scalar trampoline helpers between platforms
The loong64, ppc64, riscv64, and s390x fast trampoline emitters each
duplicated the signature validation, executable memory allocation,
cache flush and mprotect sequence, trampoline release, and (for the
fixed-width 32-bit ISAs) the instruction word emitters. Move them into
a shared scalar_trampoline.h header so each platform file only
contains its architecture-specific instruction encoding.

Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67496
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-11-27 16:26:23 -08:00
Filip Skokan 1724da82bf doc: mark X.509 generation as active development
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67781
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-27 23:17:33 +00:00
Tim Perry 4afd7d61ef crypto: make X509 AKI & SKI generation consistently reject empty input
Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67781
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-27 23:17:32 +00:00
Tim Perry f966e9f015 crypto: don't allow null in generated cert subjects, matching SANs
Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67781
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-27 23:17:31 +00:00
Tim Perry 6ce2fae7f0 crypto: fix default salt length for X509 generation with PSS
Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67781
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-27 23:17:30 +00:00
Matteo Collina 7ed1ca0256 http: keep forwarding socket 'drain' after response completes
When a server responds before it has read the whole request body, the
client stops forwarding the socket's 'drain' to the request as soon as
the response is complete. A writer that honors backpressure, such as a
stream piped into the request, then never receives 'drain', never calls
end(), and the socket keeps the process alive.

Keep the 'drain' listener until the request has ended and remove it in
responseKeepAlive() when the socket is released back to the pool.

Fixes: https://github.com/nodejs/node/issues/67763
Signed-off-by: Matteo Collina <matteo.collina@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67780
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2026-11-27 16:21:58 +00:00
Chengzhong Wu 949f252ce8 esm: unflag --experimental-import-text
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/67778
Fixes: https://github.com/nodejs/node/issues/67267
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Efe Karasakal <hi@efe.dev>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2026-11-27 16:04:43 +00:00
Christian Aurich Zanettini Martinsandlazerg 2fdac690b4 sqlite: fix abort on oversized SQL text
`expandedSQL`, `sourceSQL`, column names and the `sqlite.db.query`
trace callback passed SQL text to `String::NewFromUtf8()` without a
length, and V8 aborted on text longer than `String::kMaxLength`.
Pass the length instead. The getters and column names now throw
`ERR_STRING_TOO_LONG`, and the trace callback skips the event so the
statement still runs.

Co-authored-by: lazerg <lazerg2@gmail.com>
Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67768
Fixes: https://github.com/nodejs/node/issues/66487
Refs: https://github.com/nodejs/node/pull/66498
Reviewed-By: Guilherme Araújo <arauujogui@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-27 13:33:24 +00:00
Yuya Inoue d8333204b6 http2: add signal to compat request
Add `request.signal` to `Http2ServerRequest`, matching
`message.signal` in HTTP/1. The signal follows the stream, not the
socket: it is aborted when the stream closes before the response has
been sent completely.

Refs: https://github.com/nodejs/node/pull/62541
Refs: https://github.com/nodejs/node/pull/64392
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
Assisted-by: Claude Code
PR-URL: https://github.com/nodejs/node/pull/67774
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-27 12:32:01 +00:00
Mohamed Sayed ec0dbaab8f fs: harden the one-round-trip read and write jobs
Signed-off-by: Mohamed Sayed <k@3zrv.com>
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67112
2026-11-27 12:33:16 +01:00
Aviv KellerandBrian Muenzenmeyer 08fbdb1273 build, doc: move to redesign
Co-authored-by: Brian Muenzenmeyer <brian.muenzenmeyer@gmail.com>
Signed-off-by: avivkeller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/66713
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-27 09:19:44 +00:00
Ilyas Shabi cef4391ab3 src: use V8 using declarations consistently
Signed-off-by: ishabi <ilyasshabi94@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67732
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-27 08:43:43 +00:00
LiviaMedeiros ae8312791d tools: restrict defining Symbol.[Async]Dispose functions as aliases
Signed-off-by: LiviaMedeiros <livia@cirno.name>
PR-URL: https://github.com/nodejs/node/pull/67582
Refs: https://github.com/nodejs/node/blob/HEAD/doc/contributing/erm-guidelines.md#debuggability-of-disposer-methods
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-27 06:22:21 +00:00
LiviaMedeiros 4acb828ab7 lib: avoid defining Symbol.[Async]Dispose functions as aliases
Signed-off-by: LiviaMedeiros <livia@cirno.name>
PR-URL: https://github.com/nodejs/node/pull/67582
Refs: https://github.com/nodejs/node/blob/HEAD/doc/contributing/erm-guidelines.md#debuggability-of-disposer-methods
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-27 06:22:20 +00:00
Manjeet Singh 0089699ae3 node-api: clear the pending exception before handling it
CallIntoModule() reset last_exception only after handle_exception()
returned. When handle_exception() reports the exception through
'uncaughtException', the listener runs while the exception is still
pending, so calling back into the module from it saw the same
exception again: an addon function failed with napi_pending_exception
and rethrew it, and a finalizer run by gc() in an experimental module
reported it a second time, which aborted the process with
"Re-entrant uncaught exception detected".

Take the exception out of last_exception before handling it.

Fixes: https://github.com/nodejs/node/issues/67421
Assisted-by: a coding agent
Signed-off-by: Manjeet Singh <024manjeetsingh@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67448
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-11-27 04:42:09 +00:00
Joyee CheungandChengzhong Wu eaf46fc7a9 src: migrate to SetEmbedderDataV3
V8 16.0 removes Context::SetEmbedderData() and
Context::SetEmbedderDataV2().

Refs: https://crrev.com/c/8687878
Co-Authored-By: Chengzhong Wu <cwu631@bloomberg.net>
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/67755
Refs: https://issues.chromium.org/issues/570436596
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-27 01:52:42 +00:00
Joyee CheungandChengzhong Wu 4f97fe8bff src: migrate to SetAlignedPointerInEmbedderDataV2
V8 16.0 removes Context::SetAlignedPointerInEmbedderData().

Refs: https://crrev.com/c/8687878
Co-Authored-By: Chengzhong Wu <cwu631@bloomberg.net>
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/67755
Refs: https://issues.chromium.org/issues/570436596
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-27 01:52:40 +00:00
Chengzhong Wu 5b47a78cd3 src,build: configure V8_EMBEDDER_DATA_ARRAY_SIZE
Refs: https://issues.chromium.org/issues/570436596
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/67755
Refs: https://crrev.com/c/8687878
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-27 01:52:37 +00:00
Aviv Keller b663e55882 repl: fix promise regression
Signed-off-by: avivkeller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/67721
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-26 21:56:09 +00:00
James M Snell 345e2b2fd7 crypto: move DEP0031 to End-of-Life
Remove ecdh.setPublicKey(). ECDH only requires a private key and the
other party's public key to compute a shared secret, and
ecdh.setPrivateKey() already derives and sets the associated public
key. The native ECDH setPublicKey binding is removed as well.

diffieHellman.setPublicKey() is unaffected.

This has been a runtime deprecation since v25.0.0 and a
documentation-only deprecation since v5.2.0.

Refs: https://github.com/nodejs/node/pull/58620
Refs: https://github.com/nodejs/node/pull/3511
Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67493
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2026-11-26 13:16:55 -08:00
Aviv Keller 421ee55145 tools: link more targets with libatomic
Signed-off-by: Aviv Keller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/66851
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-11-26 13:15:50 -07:00
Nigro Simone 3872251a16 src: add MakeCallback() taking an Environment
node::MakeCallback() looks up the Environment from the creation context
of the callback on every call. An addon that calls into the same
Environment many times, a server calling one handler per request for
example, can now take it once with GetCurrentEnvironment() and pass it.
The callback must belong to that Environment.

Add a benchmark, napi/make_callback_env, comparing the two overloads.

Refs: https://github.com/nodejs/performance/issues/24
Signed-off-by: Nigro Simone <nigro.simone@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66510
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-26 19:36:48 +00:00
James M Snell 691c528d95 module: move DEP0128 to End-of-Life
A package.json whose "main" entry cannot be resolved no longer falls
back to the package's top-level index file when loaded with require().
Instead, a MODULE_NOT_FOUND error is thrown, matching the existing
behavior for packages that have no index file.

This has been a runtime deprecation since v16.0.0.

Refs: https://github.com/nodejs/node/pull/37204
Refs: https://github.com/nodejs/node/pull/26823
Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67487
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-11-26 11:18:50 -08:00
Ved Chaudhari 8592b1c8f3 permission: suggest --allow-fs-write in writeReport errors
process.report.writeReport() checks the fs.write permission in JS
and threw ERR_ACCESS_DENIED without the "Use --allow-fs-write to
manage permissions." hint that the other permission errors have.
Add it.

Refs: https://github.com/nodejs/node/pull/66969
Signed-off-by: vedchaudhari <vedc2853@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67681
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2026-11-26 19:16:31 +00:00
Yaroslav Chuhai c698e79e2e worker: fix error imports and receiver check in Web Locks
Signed-off-by: Yaroslav Chuhai <yaroslavchuhai@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67717
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-26 19:16:17 +00:00
Roberto Bianchi fa9600147d zlib: avoid mutable push in sync output collection
processChunkSync() and processSyncWithDefaults() collected output
chunks with buffers.push(), which looks up Array.prototype.push at call
time. Replacing that method from user code changed how synchronous zlib
calls such as gunzipSync() collected their output. Use indexed
assignments instead.

Signed-off-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
PR-URL: https://github.com/nodejs/node/pull/67748
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-26 19:16:04 +00:00
Tim Perry 2dd55c3d47 quic: fix eternal handle leak for HTTP/3 known header names
Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67758
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-26 18:01:46 +00:00
Yohannes Destaandwei_ds 31fff58ab2 fs: reject a mode above INT32_MAX instead of aborting
parseFileMode() accepted any 32-bit unsigned integer, but the native
bindings read the mode as a signed 32-bit integer and CHECK that it is
one. A mode between 2**31 and 2**32 - 1 therefore passed validation and
then aborted the process from fs.open(), fs.chmod(), fs.mkdir() and
their sync and promise variants. Validate the mode as a non-negative
Int32 instead so that the caller gets a RangeError.

ReadStream and WriteStream now validate options.mode in the constructor
too, so an invalid mode throws where the stream is created instead of
failing inside the open callback.

Fixes: https://github.com/nodejs/node/issues/62516
Refs: https://github.com/nodejs/node/pull/62538
Co-authored-by: wei_ds <wei_ds@126.com>
Signed-off-by: Yohannes Desta <yohannesdestagebru10@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67498
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-26 16:42:11 +00:00
Antoine du Hamel a3a45f571d tools: add linter rule to enforce use of SafePromiseAllReturnVoid
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67726
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-26 16:41:56 +00:00
Marten Richter 32d410cb10 quic: fix fix h3 session close on early str. destr
This fixes the fix from the PR #67446.
The previous PR did not allow already submitted
data, such as a Webtransport close capsule to be
transmitted to ngtcp2.
This PR instead uses the nullptr reader,
to detect a closed stream and signals eof.

This is of course only an intermediate solution,
instead quic RESET_AT semantics are a far better
solution.

Signed-off-by: Marten Richter <marten.richter@freenet.de>
PR-URL: https://github.com/nodejs/node/pull/67706
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-11-26 16:31:28 +00:00