Commit Graph
47902 Commits
Author SHA1 Message Date
avivkeller 89310c73d2 repl: add benchmarks
Signed-off-by: avivkeller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/64590
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-08-17 10:17:55 -07:00
Trivikram Kamat d95dba23d4 ffi: remove dead null check in callback arguments
InvokeCallback tested `args[i] == nullptr` and mapped the argument to
JS `null`. `args` is libffi's avalue array, and libffi always points
each slot at its own storage for the corresponding argument, so the
slot pointers are never null and the branch never ran.

The check also read as a guarantee the code does not provide: a NULL
pointer argument surfaces as the BigInt `0n`, because ToJSArgument
converts `ffi_type_pointer` values with BigInt::NewFromUnsigned. Drop
the branch rather than reimplementing it in ToJSArgument, which would
change behavior by making pointer parameters arrive as either a BigInt
or `null`.

Signed-off-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
Assisted-by: claude:opus-5
PR-URL: https://github.com/nodejs/node/pull/64998
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-08-17 16:37:15 +00:00
Trivikram Kamat 8f6c69fc4c ffi: keep FFI functions non-constructible
Use concise method functions for Fast API and shared-buffer wrappers,
and create native fallback functions with ConstructorBehavior::kThrow,
so FFI functions remain non-constructible on all invocation paths.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
PR-URL: https://github.com/nodejs/node/pull/65184
Fixes: https://github.com/nodejs/node/issues/65183
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-08-17 16:26:47 +00:00
Antoine du Hamel 3781ebc149 test: enforce exit code in test-http-server-stale-close
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65198
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-08-17 13:03:06 +00:00
Ayoub Mabrouk cc60845420 util: use more primordials in comparisons.js
PR-URL: https://github.com/nodejs/node/pull/61198
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2026-08-17 10:44:15 +02:00
Seongeun Lee 0795d827ae typings: add signal_wrap internal binding types
Add a SignalWrapBinding declaration for internalBinding('signal_wrap')
and wire it into InternalBindingMap.

Signed-off-by: leah-1ee <selee3196@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65229
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
2026-08-17 08:23:30 +00:00
Filip SkokanandArchkon 2004fbd164 debugger: wait for target startup
The inspector can accept a connection before an --inspect-brk target
enters its frontend wait. Runtime.runIfWaitingForDebugger can then be
handled too early, allowing the target to subsequently block forever.

Wait for NodeRuntime.waitingForDebugger before initializing and
releasing launched targets. Race the handshake against disconnects and
apply it to both interactive and probe startup.

Refs: https://github.com/nodejs/node/issues/64116
Assisted-by: codex:gpt-5.6-sol
Co-authored-by: Archkon <180910180+Archkon@users.noreply.github.com>
Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com>
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65194
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-08-17 11:08:38 +03:00
Seongeun Lee 671ff97a03 typings: add diagnostics_channel typings
Add a DiagnosticsChannelBinding declaration for
internalBinding('diagnostics_channel') and wire it into
InternalBindingMap.

Signed-off-by: leah-1ee <selee3196@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65227
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-08-17 08:07:48 +00:00
Seongeun Lee 11176fdfbe typings: add watchdog internal binding types
Add a WatchdogBinding declaration for internalBinding('watchdog')
and wire it into InternalBindingMap.

Signed-off-by: leah-1ee <selee3196@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65228
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-08-17 08:07:35 +00:00
Trivikram Kamat 977c20ed67 stream: avoid leaking consumers on signal failure
Validate Broadcast.push() and Share.pull() signals before registering
raw consumers. Return a rejecting iterable for pre-aborted signals
without adding a cursor.

This prevents failed subscriptions from leaving unreachable cursors
that inflate consumerCount and can permanently impose backpressure.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
PR-URL: https://github.com/nodejs/node/pull/65299
Fixes: https://github.com/nodejs/node/issues/65298
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
2026-08-17 05:02:53 +00:00
Trivikram Kamat 3abf65fc3e sqlite: validate StatementSync.run() integers
Use the standard SQLite integer conversion for changes and
lastInsertRowid. Throw ERR_OUT_OF_RANGE when a value cannot be
represented safely as a Number, or return it as a BigInt when
BigInt reads are enabled.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
PR-URL: https://github.com/nodejs/node/pull/65178
Fixes: https://github.com/nodejs/node/issues/65177
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2026-08-17 04:01:47 +00:00
greenhead 1dacb39673 stream: use validateObject for zlib/iter params
The kValidateObjectAllowArray flag matches the replaced check: arrays
keep passing and the thrown error is unchanged.

Signed-off-by: greenhead <shren0812@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65015
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-08-17 03:39:42 +00:00
greenhead 26398a94c1 stream: use validateNumber for BYOB reader options.min
The error thrown for a non-number min is unchanged.

Signed-off-by: greenhead <shren0812@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65014
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
2026-08-17 02:00:16 +00:00
greenhead 6054ff3a94 doc: fix lint clean command
Signed-off-by: greenhead <shren0812@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65274
Refs: https://github.com/nodejs/node/pull/55266
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
2026-08-17 02:00:04 +00:00
서울민트초코 9129555dc2 doc: fix typo in onboarding.md
Signed-off-by: 서울민트초코 <minseong130502@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65295
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-08-17 01:59:52 +00:00
Stewart X Addison ad7a5b8302 build: update binary-upload to use correct tarball name
the binary-upload target uses $(TARNAME)-$(OSTYPE)-$(ARCH).tar.xz as the
name to upload whereas it is created by the $(BINARYTAR) target as
$(BINARYNAME). Since BINARYNAME includes the optional VARIATION when
present this gets missed out int he binary-upload target, for example
during a release build for Alpine/musl. This commit changes the
binary-upload target to use the same variable for the tarball that is
used when the file is created.

Signed-off-by: Stewart X Addison <sxa@ibm.com>
PR-URL: https://github.com/nodejs/node/pull/65282
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-08-16 09:40:47 +00:00
Lazizbek Ergashev 46cac5a7c2 doc: add missing added: tags to fs.lchmod
Signed-off-by: Lazizbek Ergashev <lazerg2@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65283
Fixes: https://github.com/nodejs/node/issues/65280
Refs: https://github.com/nodejs/node-v0.x-archive/issues/853
Refs: https://github.com/nodejs/node/commit/3935adced09cd557a836d00558b52d777b9a20a2
Refs: https://github.com/nodejs/node/pull/18297
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-08-16 09:40:37 +00:00
Node.js GitHub Bot 04a0c270be tools: update nixpkgs-unstable to 6b5e5b7a6631f065bf6908986990b37d845
PR-URL: https://github.com/nodejs/node/pull/65224
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-08-16 08:43:26 +00:00
freida-code d099639740 test: convert test-async-local-storage-bind to async loop
Signed-off-by: freida-code <150387862+freida-code@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/65270
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-08-15 16:47:09 -07:00
Phillip Markert 86c871eced test: replace forEach() with for...of in parallel tests
Replace `Array.prototype.forEach()` with `for...of` loops across 17
tests in `test/parallel`, so each loop body reads as a plain statement
rather than an arrow callback.

None of the iterated values are sparse arrays, the one case where
`forEach` and `for...of` genuinely differ, so both constructs visit the
same elements in the same order. No callback relied on `this`, an early
return, or async behaviour, and the number of assertions run in each
file is unchanged.

Signed-off-by: Phillip Markert <phillip@ephisys.com>
PR-URL: https://github.com/nodejs/node/pull/65272
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-08-15 21:59:44 +00:00
avivkeller 86066045ea cli: add No-Op --experimental-repl-await
Signed-off-by: Aviv Keller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/64986
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-08-15 14:20:31 -07:00
NIxxy25 30bff4ad47 test: convert forEach to for in test-constant.js file
Signed-off-by: NIxxy25 <tellaoyinkansola25@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65271
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
2026-08-15 13:17:42 -07:00
Aviv Keller c73d0b1c5b worker: add wpt tests for Web Workers
Signed-off-by: Aviv Keller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/64894
Fixes: https://github.com/nodejs/node/issues/43583
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-08-15 13:15:51 -07:00
Filip SkokanandAviv Keller 78cca3671f test: enable multi-global WPTs
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Co-authored-by: Aviv Keller <me@aviv.sh>
Signed-off-by: Aviv Keller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/64894
Fixes: https://github.com/nodejs/node/issues/43583
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-08-15 13:15:49 -07:00
Aviv Keller b9afdd0b87 worker: add support for Web Workers
Signed-off-by: Aviv Keller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/64894
Fixes: https://github.com/nodejs/node/issues/43583
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-08-15 13:15:47 -07:00
Filip SkokanandAviv Keller c757550067 test: add opt-in process WPT runner
To hopefully get to the bottom of WPT crashes that have no traces.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Co-authored-by: Aviv Keller <me@aviv.sh>
Signed-off-by: Aviv Keller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/64894
Fixes: https://github.com/nodejs/node/issues/43583
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-08-15 13:15:46 -07:00
Filip SkokanandAviv Keller 5615b25f32 test: accomodate multi-global tests in WPT{Runner,TestSpec,Report}
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Co-authored-by: Aviv Keller <me@aviv.sh>
Signed-off-by: Aviv Keller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/64894
Fixes: https://github.com/nodejs/node/issues/43583
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-08-15 13:15:45 -07:00
Guilherme Araújo c7b962c222 sqlite: add diagnostic channel
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/62241
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-08-15 19:42:37 +00:00
Felix P. c2b2e3f01b test: use for-of instead of forEach
Signed-off-by: Felix P. <devfep@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65268
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-08-15 19:05:36 +00:00
Marten Richter 9ad097b82a quic: fix wake up blob
The quic implementation calls setWakeUp with
the assumption, that it is only executed once
per event loop cycle.
This assumption is wrong.
Only setImmediate will guarantee, that the
execution is delayed to later in the event loop
and happening once in the event loop.

Fixes: https://github.com/nodejs/node/issues/64035
Signed-off-by: Marten Richter <marten.richter@freenet.de>
PR-URL: https://github.com/nodejs/node/pull/64044
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-08-15 18:20:50 +00:00
Trivikram Kamat c55fa1251a test: wait for FFI background optimization
The pointer range test creates multiple closures from the same function
literals and explicitly requests synchronous optimization. V8 can also
schedule concurrent recompilation for those closures.

Wait for background optimization before closing the dynamic library so
compiler jobs cannot outlive the fast FFI metadata they reference.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
PR-URL: https://github.com/nodejs/node/pull/65300
Refs: https://github.com/nodejs/reliability/issues?q=sort%3Aupdated-desc%20%22test-ffi-fast-integer-validation%22
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-08-15 18:20:33 +00:00
greenhead 91aaf05a25 doc: fix SQLite changeset constant descriptions
Signed-off-by: greenhead <shren0812@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65265
Refs: https://www.sqlite.org/session/c_changeset_abort.html
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-08-15 14:41:37 +00:00
Matteo Collina 2929417e8a stream: consolidate non-op algorithm callbacks
The start, pull, and write non-op algorithms are all raw callbacks with
an identical empty body now, so a single shared nonOpCallback replaces
nonOpStart, nonOpPull, and nonOpWrite.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/65138
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-08-15 09:59:45 +02:00
Matteo Collina ec1a8dff6b stream: cut promise churn in webstreams hot paths
Three related reductions on the per-chunk paths:

Wrap user sink.write and source.pull callbacks without coercing their
result into a promise. When the callback returns a non-thenable (the
common synchronous case), fulfillment is guaranteed and no then() lookup
is observable, so the fulfilled reaction is enqueued through a single
shared resolved promise at the exact microtask position the coerced
promise's reaction would have had, skipping the implicit async-wrapper
promise per chunk. Thenable results go through PromiseResolve(), which
matches the spec's "a promise resolved with" conversion (identity for
native promises).

Park pipeTo's pump on backpressure by installing a record that
duck-types the writer's lazily-materialized [[readyPromise]] record and
whose resolve function is the pump continuation itself. Backpressure
clearing then resumes the pump directly instead of materializing a fresh
promise record plus reaction per flip, and the pump no longer schedules
a microtask per batch. writableStreamUpdateBackpressure publishes the
new backpressure state before resolving the ready record so the pump
observes the updated value.

Replace queueMicrotask() on the pipeTo and tee chunk-forwarding paths
with a reaction on the shared resolved promise, which enqueues the
continuation at the same position without the per-call scheduling
overhead.

pipe-to improves by 8-14% across all benchmark configurations, with
readable-read and tee also improving in spot runs.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/65138
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-08-15 09:59:45 +02:00
Matteo Collina 3e4d2e457a benchmark: apply highWaterMark in webstreams pipe-to
The highWaterMark values were passed as properties of the underlying
source and sink dictionaries, where they are ignored: a queuing
strategy's highWaterMark is read from the constructors' second argument.
Every configuration therefore measured the identical workload at the
default highWaterMark of 1, which also explains the historically high
run-to-run variance of this benchmark family.

Pass the strategies as the constructors' second argument and cover the
default (1) alongside buffered (1024, 4096) configurations.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/65138
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-08-15 09:59:36 +02:00
Matteo Collina 4551732bf1 stream: speed up async iteration of Readable
Replace the async generator backing Symbol.asyncIterator with a
hand-rolled iterator. The generator machinery costs several extra
promise allocations and microtask hops per chunk: yield awaits the
yielded value and resolves the pending request through separate
promises. Buffered chunks are now delivered as an already-resolved
promise, one microtask sooner than before.

Thenable chunks are still awaited before delivery, requests received
while a next() is outstanding are queued, and return()/throw() before
the first next() complete the iterator without touching the stream.

The earlier delivery is observable by code racing an abort against
the first chunk. The flatMap AbortSignal test relied on such a race;
it is reworked to abort deterministically while two mappers are in
flight, asserting the concurrency limit, in-flight cancellation and
rejection, without depending on delivery timing or timers.

streams/readable-async-iterator.js sync='yes': +32.59% (***)
streams/readable-async-iterator.js sync='no': +9.84% (***)

Assisted-by: Claude Fable 5
Signed-off-by: Matteo Collina <matteo.collina@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64447
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2026-08-14 22:44:35 +00:00
Guilherme Araújo c8996eaec9 sqlite: add stmt persistent flag
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/62757
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
2026-08-14 21:57:31 +00:00
Trevor Burnham c4b755ee00 sqlite: reject connection access from authorizer callbacks
SQLite requires that an authorizer callback not modify the connection
that invoked it, and counts sqlite3_prepare_v2() and sqlite3_step() as
modifications. node:sqlite let the callback call prepare(), exec(), the
statement execution methods, and other connection-mutating APIs on the
same DatabaseSync. Track authorizer depth on DatabaseSync with an RAII
guard around the callback and throw ERR_INVALID_STATE from the affected
entry points while it is on the stack. Covering every authorizer
invocation, including the re-prepare that SQLite can run during
sqlite3_step(), exposed a second and distinct hazard: reentering a
statement that is currently being stepped is a use-after-free rather
than a contract violation, since finalizing it frees the virtual machine
under sqlite3_step() and re-running it resets that machine
mid-execution. Any callback SQLite invokes during execution can reach
it, so a user-defined function is enough. Track the statements currently
being stepped and reject reentry into only those, which leaves a
user-defined function free to prepare, run, and finalize its own helper
statements.

Signed-off-by: Trevor Burnham <trevorburnham@gmail.com>
Fixes: https://github.com/nodejs/node/issues/63207
Assisted-by: claude:opus-5
PR-URL: https://github.com/nodejs/node/pull/65156
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-08-14 21:43:35 +00:00
Trivikram Kamat bc813a7a6d stream: preserve falsy cancellation reasons
Use undefined as the no-error sentinel when cancelling broadcast and
share consumers. This ensures that 0, an empty string, false, and null
are propagated instead of being converted to clean completion.

Make sync share surface cancellation reasons before handling detached
consumers, and add regression coverage for async and sync consumers.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
PR-URL: https://github.com/nodejs/node/pull/64705
Fixes: https://github.com/nodejs/node/issues/64704
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-08-14 20:50:14 +00:00
Matteo Collina 553aec1f7f doc: document open pull request limit
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/65250
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Stewart X Addison <sxa@redhat.com>
Reviewed-By: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Beth Griggs <bethanyngriggs@gmail.com>
2026-08-14 20:50:00 +00:00
ulofiai 38e3955691 deps: cherry-pick libuv/libuv@e640dc9
Signed-off-by: ulofiai <monsterking@tutamail.com>
PR-URL: https://github.com/nodejs/node/pull/65118
Fixes: https://github.com/nodejs/node/issues/63638
Refs: https://github.com/libuv/libuv/pull/5152
Refs: https://github.com/libuv/libuv/commit/e640dc93c79e1b930e320853a5f9f65fa489158d
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-08-14 20:02:08 +00:00
Node.js GitHub Bot 9cf2ce75f2 deps: update perfetto to 57.2
PR-URL: https://github.com/nodejs/node/pull/65114
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-08-14 18:33:27 +00:00
Maya Lekova f83e7df961 test: add a simple test for import defer of a CJS module
This tests imports a CommonJS modules with the `defer` modifier.
It ensures that the imported module is not evaluated before
accessing properties from its exports.

Signed-off-by: Maya Lekova <maya@igalia.com>
PR-URL: https://github.com/nodejs/node/pull/64694
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2026-08-14 16:14:58 +00:00
Joyee Cheung 3a35e48ea7 inspector: avoid calling into JS from V8 interrupts
Our inspector implementation dispatches inspector messages from
a V8 interrupt handler, so they could be handled during an arbitrary
point of JS execution where re-calling into another irrelevant JS
code is not safe.

This patch tracks V8 interrupt state in this case and rewrite the
async hook toggling as state reconciliation, so requests only record
the desired state, which is applied once calling into JS is possible
and safe, and the actual invocation is deferred to an immediate when
inside an interrupt. This simplifies the previous mechanism and
makes re-entracy and early termination safer.

Drive-by: skip installing command line API extensions during
teardown when calling into JS is no longer safe.

Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65028
Refs: https://issues.chromium.org/u/1/issues/42212250
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/8173727
Refs: https://github.com/nodejs/node/pull/26935
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-08-14 16:14:48 +00:00
James M Snell db138c434c meta: add unified http api initiative
HTTP APIs in Node.js have become a bit of a mess.

We have separate `node:http`, `node:https`, and `node:http2`
modules. We have separate `fetch` implementation. We have
`http3` support in development. There are new http features
like datagrams and priorities that are entirely unsupported,
etc.

This strategic initiative will be focused on the development
of a unified HTTP API built around the web standard fetch
model. Client and Server.. independent of underlying transport
and updated to modern HTTP protocol capabilities.

Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65139
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
2026-08-14 15:09:48 +00:00
Yagiz Nizipli 967d4af565 zlib: convert classes to modern syntax and eol DEP0184
Convert ZlibBase, Zlib, and the remaining zlib/Brotli stream
constructors to ES6 class syntax. Calling these constructors without
`new` is no longer supported (DEP0184 End-of-Life); use `new` or the
create* factory helpers instead.

This is a semver-major change: code that relied on `zlib.Gzip()`
(without `new`) will now throw TypeError. The createGzip/createDeflate
helpers and all documented `new`-based usage remain unchanged. The
wire behavior and public options are preserved.

Refs: https://github.com/nodejs/node/pull/55718
Refs: https://github.com/nodejs/node/pull/54708
Assisted-by: Grok
Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
PR-URL: https://github.com/nodejs/node/pull/64849
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-08-14 14:52:07 +00:00
Harjoth Khara 9e23066b8a doc: document http2 header constants
Signed-off-by: harjoth <harjoth.khara@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64548
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-08-14 03:39:59 +00:00
Philipp Dunkel 91a99c5e5c zlib: roll back a failed add() directory rewrite
add()/addEntrySync() advanced the central-directory offset and adopted
the new entry into memory before the final directory rewrite. If that
rewrite failed (ENOSPC/EIO after the member bytes were already written),
the in-memory state and the on-disk archive were left diverged and
half-updated, with no restore, corrupting the next add().

Wrap the rewrite: on failure, restore the previous offset and directory
entry and rewrite the original directory back, leaving the archive and
handle exactly as before the call, then rethrow.

Signed-off-by: Philipp Dunkel <pip@pipobscure.com>
PR-URL: https://github.com/nodejs/node/pull/65016
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-08-14 03:39:49 +00:00
Philipp Dunkel ad736a851e zlib: let a ZipFile read finish before close()
An entry read runs on a file descriptor shared with its ZipFile, but
reads did not take part in close()'s lifecycle: close() marked the
handle closed and released the fd while a read was still in flight, so
the read landed on a closed - or worse, an OS-reused - descriptor
(surfacing as EBADF, or a cross-file read once the number was
reclaimed), despite the class comment promising otherwise.

Track in-flight reads on the shared handle. close() now marks the handle
closing (rejecting new reads at once), waits for the in-flight reads to
finish on the still-open fd, and only then closes it; closeSync(), which
cannot wait, refuses while an asynchronous read is outstanding.

Signed-off-by: Philipp Dunkel <pip@pipobscure.com>
PR-URL: https://github.com/nodejs/node/pull/65016
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-08-14 03:39:47 +00:00
Philipp Dunkel e7834cdbd0 test: cover ZIP fd lifecycle and add rollback
Add regression tests for two node:zlib ZipFile robustness issues:

- A read in flight when close() is called must complete on a live
  descriptor; close() must not release the fd out from under it (which
  surfaces as EBADF, or an OS-reused-fd cross-file read).
- If the central-directory rewrite fails after add() has written the
  member bytes, both the in-memory state and the on-disk archive must be
  rolled back, not left half-updated.

Signed-off-by: Philipp Dunkel <pip@pipobscure.com>
PR-URL: https://github.com/nodejs/node/pull/65016
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-08-14 03:39:45 +00:00