Commit Graph
47127 Commits
Author SHA1 Message Date
Yagiz Nizipli cf89b61932 sqlite: do not leave database open after failed open
When sqlite3_open_v2() fails, SQLite still assigns a database handle
in a "sick" state. Such a handle may only be used to retrieve the
error and must then be released with sqlite3_close(). Keeping it in
connection_ meant that after a failed open():

- isOpen incorrectly reported true,
- every method passed the "database is not open" check and called
  SQLite APIs on the sick handle, which is an API misuse,
- registering a user-defined function leaked its user data in builds
  with SQLITE_ENABLE_API_ARMOR, because SQLite rejects the call
  before taking ownership of the user data,
- open() could not be retried since the database appeared open.

Close and reset the connection handle when open() fails at any point
so that the database remains closed and open() can be retried.

Fixes: https://github.com/nodejs/node/issues/63831
Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
PR-URL: https://github.com/nodejs/node/pull/63854
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
2026-06-16 16:29:30 +00:00
Filip Skokan dbaf45cfbe crypto: make webcrypto aliasKeyFormat directional
The helper no longer treats every raw alias the
same way and unintended values were accepted for
some algorithms.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63910
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2026-06-16 11:34:37 +00:00
Antoine du HamelandMatteo Collina 65ffd025a5 stream: only pass the expected number of parameters to callbacks
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/63909
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-06-16 09:35:29 +00:00
Node.js GitHub Bot 80ea3786d0 deps: update undici to 8.5.0
PR-URL: https://github.com/nodejs/node/pull/63903
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-06-16 09:35:14 +00:00
Paolo InsognaandBryan English 3e55527eef ffi: add experimental fast FFI call API for AArch64 and x86_64
Add fast API trampolines for AArch64 and x86_64.

IsJitMemorySupported() maps an RW page, writes a ret instruction
(0xD65F03C0 AArch64 / 0xC3 x86_64), and mprotects it to RX. A
successful RX transition is treated as the support signal. The page is
deliberately not executed: this check may run during normal operation
(when an FFI function is first created), and executing freshly written
code from a capability probe could SIGSEGV/SIGKILL the process on
systems that block executable memory. The real trampoline emitter
performs the same mprotect at creation time and falls back to libffi
when it is rejected.

The result is computed once via std::call_once and cached for the
lifetime of the process, so concurrent callers never observe a
provisional value.

Wired into CreateFastFFIMetadata() for early nullptr bail-out when
JIT memory is unavailable.

Windows stub returns false (no trampolines yet on this branch).

IsFastCallEligible() validates at parse time whether a signature can
use the fast-call path, covering:

- Return and argument type eligibility (numeric, pointer; no structs)
- Argument count cap (8, matching V8 fast-call limit)
- Per-ABI register pressure limits that mirror the trampoline emitters
  (AArch64 and x86_64 SysV). Platforms without an emitter, including
  Win64, are reported ineligible.
- Buffer and float args cannot coexist, and buffer args additionally
  consume an extra GP register slot on both supported ABIs.

The arg/arg-name lengths are checked before the per-arg loop so a
malformed signature cannot index out of bounds.

Returns nullptr from CreateFastFFIMetadata() for ineligible signatures,
falling back to libffi.

Co-authored-by: Bryan English <bryan@bryanenglish.com>
Signed-off-by: Paolo Insogna <paolo@cowtech.it>
Signed-off-by: Bryan English <bryan@bryanenglish.com>
Assisted-By: OpenAI:GPT-5.5 <openai/gpt-5.5>
PR-URL: https://github.com/nodejs/node/pull/63068
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
2026-06-16 09:35:02 +00:00
Node.js GitHub Bot 81c4f0a22e test: update WPT for url to d4598eba09
PR-URL: https://github.com/nodejs/node/pull/63899
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-06-16 10:23:55 +02:00
Daijiro Wachi 6e8c1717e2 stream: fix dropped first chunk in Utf8Stream buffer mode
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63833
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Mattias Buelens <mattias@buelens.com>
2026-06-16 02:30:51 +00:00
Daijiro Wachi 5ee27e3f24 util: fix scientific notation formatting
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63823
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2026-06-16 02:30:40 +00:00
Node.js GitHub Bot 5ec8cdc7f9 test: update WPT for WebCryptoAPI to 03a1476844
PR-URL: https://github.com/nodejs/node/pull/63900
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-06-16 01:34:10 +00:00
Node.js GitHub Bot 190bd4ff14 test: update WPT for urlpattern to 23aac92784
PR-URL: https://github.com/nodejs/node/pull/63898
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-06-16 01:33:42 +00:00
MadelynandFilip Skokan 463e56fb00 crypto: runtime-deprecate calling Hmac.digest() more than once
Emit a DEP0206 deprecation warning when Hmac.digest() is called on an
already-finalized instance. This behavior is inconsistent with
Hash.digest() which throws ERR_CRYPTO_HASH_FINALIZED.

Fixes: https://github.com/nodejs/node/issues/62838
Co-authored-by: Filip Skokan <panva.ip@gmail.com>
Signed-off-by: developers-universe-1 <madelynreyes2026@gmail.com>
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63624
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-06-15 21:22:58 +00:00
Guy Bedford 723dd38882 dgram: add synchronous Socket.prototype.bindSync()
Provides sync non-blocking bind(2), without DNS lookup

Signed-off-by: Guy Bedford <guybedford@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63838
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-06-15 19:01:36 +00:00
Trivikram Kamat c2f20136b1 debugger: await initialization after run and restart
Ensure the debugger CLI waits for post-connect initialization before
resolving the run and restart commands. This prevents tests and users
from observing a prompt before Runtime.runIfWaitingForDebugger() has
released the new debuggee.

Refs: https://github.com/nodejs/node/issues/61762

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
PR-URL: https://github.com/nodejs/node/pull/63607
Refs: https://github.com/nodejs/node/issues/61762
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2026-06-15 19:01:19 +00:00
Trivikram Kamat 6ed5783125 doc: clarify fromReadable() duck-typed contract
Document that duck-typed readable inputs must provide off() in addition
to read() and on(), matching the cleanup behavior in the implementation.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/63682
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2026-06-15 15:45:45 +00:00
Daijiro Wachi 3f42cfacf2 doc: fix typo in cli.md
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63883
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2026-06-15 09:42:39 +00:00
Daijiro Wachi 3ad2463848 util: fix -0 formatting when numericSeparator is enabled
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63815
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2026-06-15 17:55:40 +09:00
Trivikram Kamat 9d2db708ca stream: remove transform-writer handling in pipeTo
The pipeTo() and pipeToSync() argument parser already requires the
destination argument to be a writer. Remove the later transform-writer
handling so writer objects with a transform() method are treated only
as destinations.

Fixes: https://github.com/nodejs/node/issues/63683

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
PR-URL: https://github.com/nodejs/node/pull/63684
Fixes: https://github.com/nodejs/node/issues/63683
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-06-15 03:49:40 +00:00
Yagiz Nizipli aa25a0a30c src: handle empty MaybeLocal in cjs_lexer::Parse
CreateString() and Parse() in node_cjs_lexer.cc unconditionally called
ToLocalChecked() on the results of String::NewFromOneByte(),
String::NewFromUtf8() and Set::Add(). If string or handle allocation
fails or an exception is pending on the isolate, these return an empty
MaybeLocal and ToLocalChecked() aborts the process with
"FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal".

Since Parse() is on the hot path of every ESM import of a CJS module
(cjsPreparseModuleExports), propagate the failure as a regular pending
JavaScript exception instead so callers can recover.

Fixes: https://github.com/nodejs/node/issues/63323
Refs: https://github.com/nodejs/node/pull/61456
Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
PR-URL: https://github.com/nodejs/node/pull/63885
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2026-06-15 01:30:52 +00:00
Haram Jeong 120c2a4558 crypto: fix unhandled error in Hash._transform
Signed-off-by: haramjeong <04harams77@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63261
Fixes: https://github.com/nodejs/node/issues/63258
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-06-14 15:22:50 +00:00
Tim Perry 2b750782ac quic: fix broken listEndpoints export, test callbacks & nghttp3 include
Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63874
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-06-14 13:06:39 +00:00
Gürgün Dayıoğlu 4fb667e7a3 src: fast path empty native immediate drain
Signed-off-by: Gürgün Dayıoğlu <hey@gurgun.day>
PR-URL: https://github.com/nodejs/node/pull/62969
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-06-14 10:50:16 +00:00
Daijiro Wachi 3501b3e446 test: add tests for 3 methods in utils
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63765
Refs: https://app.codecov.io/gh/nodejs/node/blob/main/lib%2Futil.js
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2026-06-14 07:01:35 +00:00
Anna Henningsen 2fb168f756 src: do not track weak BaseObjects as childrens of Realms
Heap dumps are used for analyzing the relationship between
objects that keep each other alive, so that retainers of
memory can be detected and memory leaks fixed.

6e60ab744e broke this for a wide range of `BaseObject`
instances. Marking all `BaseObject`s, including weak ones,
as children of `Realm` and `Environment` instances gives
the incorrect impression that they are held alive by those
objects, effectively hiding the "real" set of strong roots
that keep other objects alive through GC.

An upcoming change in V8 will allow us to represent this
relationship between `Realm` and `Environment` and its
`BaseObject` and `CppgcMixin` instances properly.

Refs: https://github.com/v8/v8/commit/e37cadf1143a8c5bbe44c0408186b5a26cc23863
Refs: https://github.com/nodejs/node/pull/57417
Signed-off-by: Anna Henningsen <anna@addaleax.net>
PR-URL: https://github.com/nodejs/node/pull/63842
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-06-13 23:12:35 +00:00
Anna Henningsen 17285d34de src: allow tracking children in MemoryTracker with weak edges
Allowing the addition of child nodes with a weak edge
between them enables expressing a relationship of the
"node A keeps track of node B and no other node does,
but node A does not keep node B alive" kind, which is
the relationship between `Realm`s and weak `BaseObject` instances.
This is a prerequisite for the following commit.

Note that the relevant V8 feature is not available
in Node.js yet. It's still worth doing this, both
because it allows us to prepare for that upstream
change, and because the current representation of
these edges in heap dumps is factually incorrect
and hinders debugging in existing Node.js versions.

Refs: https://github.com/v8/v8/commit/e37cadf1143a8c5bbe44c0408186b5a26cc23863
Signed-off-by: Anna Henningsen <anna@addaleax.net>
PR-URL: https://github.com/nodejs/node/pull/63842
Refs: https://github.com/nodejs/node/pull/57417
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-06-13 23:12:34 +00:00
Guy Bedford 1efdce3353 net: support TCP_KEEPINTVL and TCP_KEEPCNT in setKeepAlive
Signed-off-by: Guy Bedford <guybedford@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63825
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-06-13 23:12:25 +00:00
Anna Henningsen fc28d9402f src: officially deprecate node::ObjectWrap
This interface has long been unmaintained and doesn't
match current best practices for C++ object management.

It's also simply not a good idea to have this header be
part of Node.js core; since it is an inline header, user
code will depend on the Node.js version it was compiled with,
and there is no way to adopt changes to this header
independently of changing the target Node.js version.

Better userland alternatives exist and have long been
more popular, notably, `node-addon-api` and, for use cases
where direct V8 API access is required, `nan`.

Signed-off-by: Anna Henningsen <anna@addaleax.net>
PR-URL: https://github.com/nodejs/node/pull/63756
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-06-13 23:12:14 +00:00
Calvin d097de8855 doc: reserve NMV 149 for Electron 44
Signed-off-by: Calvin Watford <clavin@electronjs.org>
PR-URL: https://github.com/nodejs/node/pull/63859
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-06-13 21:48:56 +00:00
Joyee Cheung 8c4ec8a674 debugger: add --max-hit option to probe mode
This option provides a new way of terminating the probing by
specifying a limit for the per-probe hit evaluation. When any
probe reaches the limit, the session removes the V8 breakpoints
and finishes with a `completed` terminal event rather than waiting
for the target to exit or timeout. This would be useful when we
provide a way to attach to and probe a running process in the future.

Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63704
Refs: https://github.com/nodejs/node/issues/63646
Reviewed-By: Jan Martin <jan.krems@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-06-13 20:50:15 +00:00
npm CLI robot 36bcfa7913 deps: upgrade npm to 11.17.0
PR-URL: https://github.com/nodejs/node/pull/63857
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
2026-06-13 19:08:33 +00:00
Renegade334 f2e3c108d8 lib: improve control abstraction coverage in frozen intrinsics
Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>
PR-URL: https://github.com/nodejs/node/pull/63698
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-06-13 17:31:17 +00:00
Renegade334 be93790f23 lib: add Iterator global to primordials
Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>
PR-URL: https://github.com/nodejs/node/pull/63698
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-06-13 17:31:16 +00:00
沈鸿飞 96cff6096a deps: add ngtcp2_fmt.c to build configuration (ngtcp2.gyp)
PR-URL: https://github.com/nodejs/node/pull/63821
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2026-06-13 11:02:21 +00:00
Matteo Collina de67c5ca63 fs: support caller-supplied readFile() buffers
Signed-off-by: Matteo Collina <matteo.collina@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63634
Fixes: https://github.com/nodejs/node/issues/63600
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2026-06-13 10:08:05 +00:00
Daijiro Wachi b3042c7b68 test_runner: remove unused shuffleArrayWithSeed
shuffleArrayWithSeed was introduced along with test order
randomization but was never called: the feature picks a random
pending subtest at dequeue time using createSeededGenerator
directly. Remove the dead helper and its export, and add direct
unit coverage for createSeededGenerator's deterministic contract.

Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63847
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-06-13 09:02:10 +00:00
Robert Nagy 4383f67279 buffer: optimize Buffer.prototype.copy
Route the native backing of Buffer.prototype.copy (CopyImpl, the `_copy`
binding) through V8's new v8::ArrayBuffer::CopyArrayBufferBytes API
(added in the preceding commit) instead of materializing an
ArrayBufferViewContents and doing a manual memmove. This speeds up
partial copies (sourceStart > 0). All copies now go through this
binding: the previous %TypedArray%.prototype.set fast-path for
whole-buffer copies is dropped, since it would throw on a detached or
immutable target rather than report a 0-byte no-op, and the benchmarks
below show the native path is comparable for that case.

When both sides are backed by a SharedArrayBuffer the relaxed-atomic
overload is used, which honors the SharedArrayBuffer memory model.
Mixed copies (one SharedArrayBuffer, one ArrayBuffer) use the regular
overload.

copy() now reports the number of bytes actually copied, as returned by
V8: 0 when the target is backed by a detached or immutable ArrayBuffer.
The copy is then a no-op rather than a write to read-only memory.

The native binding now plumbs byte offsets and the copied-byte count
through as size_t, passed across the fast/slow API boundary as doubles
(exact for integer values below 2^53), so copies that cross the 4 GiB
boundary are no longer truncated to 32 bits.

buffer-copy.js vs node v26.3.0 (x64, 30 runs):
  partial=false bytes=1024:  +7.91%  (***)
  partial=false bytes=128:   +0.17%
  partial=false bytes=8:     -0.89%
  partial=true  bytes=1024: +22.33%  (***)
  partial=true  bytes=128:  +19.58%  (***)
  partial=true  bytes=8:    +18.70%  (***)

This supersedes the prototype in
https://github.com/nodejs/node/pull/62491, which added a bespoke
ArrayBufferView::FastCopy instead of using the upstream-friendly
CopyArrayBufferBytes API.

Adds SharedArrayBuffer and immutable-ArrayBuffer coverage to the buffer
copy tests, plus a pummel regression test for copies larger than 2^32
bytes.

Refs: https://github.com/nodejs/node/issues/55422
Signed-off-by: Robert Nagy <ronagy@icloud.com>
Assisted-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR-URL: https://github.com/nodejs/node/pull/63828
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
2026-06-12 23:26:19 +00:00
Robert Nagy d66c3a6c0f deps: V8: add CopyArrayBufferBytes API
Add v8::ArrayBuffer::CopyArrayBufferBytes and
v8::SharedArrayBuffer::CopyArrayBufferBytes, which copy a byte range
from one backing store to another. V8 clamps the byte range and handles
detached and immutable buffers: nothing is copied when the source is
detached or the target is detached or immutable, and the number of bytes
actually copied is returned. The SharedArrayBuffer overload uses a
relaxed-atomic memmove that honors the SharedArrayBuffer memory model.

Carried as a floating patch cherry-picked from:

    https://chromium-review.googlesource.com/c/v8/v8/+/7735151

That CL is authored by a Node.js collaborator (Ben Noordhuis) and is
expected to land upstream, so the floating patch should be easy to
maintain: it touches nothing but the public ArrayBuffer API and can be
dropped wholesale on the next V8 upgrade that includes it.
v8_embedder_string is bumped to -node.21 accordingly.

Refs: https://chromium-review.googlesource.com/c/v8/v8/+/7735151
Signed-off-by: Robert Nagy <ronagy@icloud.com>
PR-URL: https://github.com/nodejs/node/pull/63828
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
2026-06-12 23:26:18 +00:00
Daijiro Wachi 20fda5692e doc: fix typo in vm.md
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63881
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-06-12 21:45:48 +00:00
Daijiro Wachi 8c43981593 doc: fix typo in packages.md
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63882
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-06-12 21:08:07 +00:00
Maël Nison 2f2b81095b loader: implement package maps
Signed-off-by: Mael Nison <nison.mael@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/62239
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-06-12 16:02:01 +00:00
Chengzhong Wu 11390b53bc build: remove redundant intermediate node_aix_shared
With the introduction of always static target `node_base`,
`node_aix_shared` is now redundant.

Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/63747
Refs: https://github.com/nodejs/node/pull/63626
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-06-12 14:53:41 +00:00
Antoine du Hamel 144f795956 tools: align Bash snippets in GHA with lint-sh conventions
Our shell scripts enforce passing arbitrary values via
quoted env variables to avoid injections.

Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63829
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
2026-06-12 10:08:16 +00:00
Trivikram Kamat 141a504680 test: mark SEA tests flaky on linux arm debug
The LIEF-based --build-sea tests can be killed by the OS on the
linux arm debug CI worker while rebuilding the ELF binary. The failures
all happen after SEA serialization succeeds, when the injector enters
LIEF::ELF::Builder::build(), and report SIGKILL instead of a test
assertion failure.

Mark the affected SEA build and application test families as flaky only
on linux arm debug, matching the node-test-commit-arm-debug job where
the flakes have been observed.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/63743
Refs: https://github.com/nodejs/reliability/blob/main/reports/2026-06-10.md
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2026-06-11 18:17:44 +00:00
Brian Meek 0b07f2cadf vm: fix property queries for proxy sandboxes
Signed-off-by: Brian Meek <55990082+brianathere@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/63742
Fixes: https://github.com/nodejs/node/issues/63739
Refs: https://github.com/nodejs/node/pull/63549
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-06-11 15:49:20 +00:00
Node.js GitHub Bot da00166a68 deps: update archs files for openssl-3.5.7
PR-URL: https://github.com/nodejs/node/pull/63820
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-06-11 14:28:08 +00:00
Node.js GitHub Bot 0a58d4461d deps: upgrade openssl sources to openssl-3.5.7
PR-URL: https://github.com/nodejs/node/pull/63820
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-06-11 14:28:07 +00:00
Stewart X Addison 4241d0d968 ffi: port semi-colon fix for riscv64 (and others)
Signed-off-by: Stewart X Addison <sxa@ibm.com>
PR-URL: https://github.com/nodejs/node/pull/63794
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-06-10 17:20:16 +00:00
Marten Richter e6a8d06767 quic: impl. cb for http/3 settings/app. options
Implements a callback that is invoked once http/3
settings are received.
Background, http/3 settings usually arrive a bit
later than connection establishment, and e.g. for
webtransport these settings are used to indicate
support. So e.g. the examples for quiche from
 google, wait for the settings to arrive.
 (This is different to http/2).
The implemented callback mechanism allows to wait
for the settings to arrive until connection
attempts are made. As settings are stored in the
generic applications option object, the callback's
 name refers to the application rather than the
 settings. Whether this is a good choice is
 debatable.

Fixes: https://github.com/nodejs/node/issues/63553
Signed-off-by: Marten Richter <marten.richter@freenet.de>
PR-URL: https://github.com/nodejs/node/pull/63558
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-06-10 13:33:00 +00:00
Antoine du Hamel 1778eeb6e4 lib: add lint rule to enforce use of kEmptyObject
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63790
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-06-10 10:56:56 +00:00
Daijiro Wachi 19c46abbef lib: insert argv[0] at argv[1] in setDeserializeMainFunction
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/62928
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-06-10 11:36:03 +09:00
Filip Skokan a6c7477540 crypto: refactor keyObject.toCryptoKey() and SubtleCrypto.getPublicKey()
Move KeyObject.prototype.toCryptoKey() onto the base KeyObject
class and dispatch from the cached native key type. Both secret and
asymmetric conversions now pass a KeyObjectHandle through the Web
Crypto import paths.

Expose KeyObjectHandle.prototype.getKeyType() so asymmetric importers
can validate public/private usages without wrapping the handle back
into a KeyObject. Secret importers likewise consume KeyObjectHandle
directly.

Use the shared asymmetric conversion helper to derive public
CryptoKeys for SubtleCrypto.getPublicKey(), avoiding the temporary
PrivateKeyObject/createPublicKey round trip while keeping usage
validation in the import path.

Update getPublicKey and KeyObject.toCryptoKey tests to be driven from
the Web Crypto supported-algorithm registry so new algorithms require
either coverage or an explicit skip.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63622
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-06-09 19:48:16 +00:00