Commit Graph
49842 Commits
Author SHA1 Message Date
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
Yuya Inoue 4d544ead13 doc: clarify PR closing keyword handling
Document that the landing tool accepts Closes: and Resolved: and records
them as Fixes: trailers.

Refs: https://github.com/nodejs/node/pull/67696#issuecomment-7101938071
Assisted-by: Codex
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67731
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-26 16:31:11 +00:00
Ved Chaudhari 3c15087582 lib,src: reset TextDecoder after a decoding error
A fatal decode() error now resets the decoder, as the Encoding
Standard requires, so the next call does not continue with the bytes
or BOM state from before the error.

Signed-off-by: vedchaudhari <vedc2853@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67610
Fixes: https://github.com/nodejs/node/issues/67604
Refs: https://github.com/whatwg/encoding/pull/369
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-26 16:19:32 +00:00
Roberto Bianchi 270d4f3651 stream: avoid mutable push in writable end callbacks
Writable.prototype.end() queued its callback with .push() on a private
array, which looks up Array.prototype.push at call time. Replacing that
method from user code made end() throw or drop the callback. Use an
indexed assignment instead.

Signed-off-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
PR-URL: https://github.com/nodejs/node/pull/67751
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
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: Luigi Pinca <luigipinca@gmail.com>
2026-11-26 16:03:37 +00:00
Tim Perry 7da2308afc quic: create streams synchronously
Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67749
Reviewed-By: Efe Karasakal <hi@efe.dev>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-11-26 13:41:12 +00:00
Antoine du Hamel 4325ce0a57 2026-11-26, Version 27.0.0-alpha.0.2.0 (Alpha)
Notable changes:

doc:
  * deprecate `util.TextDecoder` and `util.TextEncoder` (LiviaMedeiros) https://github.com/nodejs/node/pull/67461
http2:
  * (SEMVER-MINOR) add writeProcessing to compat response (Yuya Inoue) https://github.com/nodejs/node/pull/67728
  * (SEMVER-MINOR) add missing setHeaders (jakecastelli) https://github.com/nodejs/node/pull/67597
  * (SEMVER-MINOR) add callback to informational header methods (Yuya Inoue) https://github.com/nodejs/node/pull/67470
lib:
  * (SEMVER-MINOR) graduate the --process-timeout option (James M Snell) https://github.com/nodejs/node/pull/67506
os:
  * (SEMVER-MINOR) expose `guessFileDescriptorType` (Vlad Frangu) https://github.com/nodejs/node/pull/58060
sqlite:
  * (SEMVER-MINOR) throw ERR_NO_SQLITE without SQLite support (Christian Aurich Zanettini Martins) https://github.com/nodejs/node/pull/67727
  * (SEMVER-MINOR) add statement.columnCount getter (Guilherme Araújo) https://github.com/nodejs/node/pull/67658
  * mark as stable (Christian Aurich Zanettini Martins) https://github.com/nodejs/node/pull/67654
src:
  * (SEMVER-MINOR) expand --process-timeout output to include workers (James M Snell) https://github.com/nodejs/node/pull/67712
  * (SEMVER-MINOR) restore tty state on exit only if changed (Matteo Collina) https://github.com/nodejs/node/pull/66753
tls:
  * (SEMVER-MINOR) docs-deprecate TLS renegotiation, add allowRenegotiation opt-in (Tim Perry) https://github.com/nodejs/node/pull/67532

PR-URL: https://github.com/nodejs/node/pull/67757
2026-11-26 09:43:02 +01:00
René fa49b1361b build: add synchronization.lib to crates build on Windows
Signed-off-by: René <rene@renegade334.me.uk>
PR-URL: https://github.com/nodejs/node/pull/67590
Fixes: https://github.com/nodejs/node/issues/67589
Reviewed-By: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2026-11-26 02:33:07 +00:00
Beth Griggs f31711c6a7 tools,build: add CycloneDX SBOM generation
Add tools/sbom/generate_sbom.py, a stdlib-only Python 3 script that
writes a CycloneDX 1.7 SBOM describing the bundled dependencies of the
Node.js binary.

The script reads config.gypi to determine which dependencies are
active in the build, then extracts each one's version from whichever
file records it: C headers, CMakeLists.txt, package.json, Cargo.toml
and others. A version that cannot be read is reported as "unknown"
with a warning rather than failing the run. Dependencies satisfied by
a system library or disabled via a configure flag are omitted, so the
document lists only what ships in the build.

The root component records a pkg:generic/nodejs/node purl, the git
commit SHA as a hash on a VCS external reference, V8's embedder string
and the build machine's hostname. Its version, and the file name,
match process.version, including -pre, -alpha.* and `--tag=` suffixes.

A formulation section records the build environment: the C/C++
compiler, rustc, cargo and nasm versions that ./configure recorded in
config.gypi, their distro package versions on Linux, the host's glibc
version, and the ./configure command from config.status. Each probe is
independent, and anything undetermined is left out rather than failing
generation. The C and C++ compilers are named by product - gcc, clang
or apple-clang - since the version alone is ambiguous: Apple clang
17.0.0 is not upstream clang 17. configure.py now records those
products and versions, plus rustc and cargo, in config.gypi.

Output defaults to out/Release/node-v{version}-sbom.json, overridable
with SBOM_OUTPUT.

New Makefile targets:

  make sbom       - generate the SBOM (requires ./configure first)
  make test-sbom  - validate the generated SBOM

doc/contributing/maintaining/maintaining-dependencies.md now asks for a
DEP_CATALOG entry when adding a dependency, so new deps do not silently
go missing from the SBOM. tools/sbom/README.md covers the output and
how to generate it.

Unit tests in test/tools/test_generate_sbom.py cover catalog structural
correctness, the version extractors, scope resolution and deps/
coverage. They run under the existing `make tooltest` target.

Refs: https://github.com/nodejs/security-wg/issues/1115

Signed-off-by: Beth Griggs <bethanyngriggs@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66761
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stewart X Addison <sxa@redhat.com>
2026-11-25 21:19:04 +00:00
Nigro Simone 72bf3926bf node-api: find the Environment once
Without an async context, napi_make_callback went through the public
node::MakeCallback(), which looks up the Environment from the creation
context of the callback on every call. The napi_env already knows it,
so call into it directly, as the path with an async context does.
node_napi_env__::node_env() also looked it up from the context on every
call: find it once, a napi_env lives as long as its Environment.

Add a benchmark, napi/make_callback_napi.

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/66509
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-11-25 20:16:27 +00:00
Roberto Bianchi 5a76601c8f events: use indexed appends in eventNames
Collect active event names with indexed writes instead of calling
the primordial push function for each name.

Signed-off-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
PR-URL: https://github.com/nodejs/node/pull/66875
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-25 20:16:12 +00:00