Commit Graph

43965 Commits

Author SHA1 Message Date
Node.js GitHub Bot
085b0281d9
deps: update zstd to 1.5.7
PR-URL: https://github.com/nodejs/node/pull/57940
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-04-22 00:52:12 +00:00
Node.js GitHub Bot
9761584b66
deps: update simdutf to 6.5.0
PR-URL: https://github.com/nodejs/node/pull/57939
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-04-22 00:52:03 +00:00
Edy Silva
e9b286ca4b
sqlite: add location method
PR-URL: https://github.com/nodejs/node/pull/57860
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2025-04-21 14:57:15 +00:00
Augustin Mauroy
64d9b7c5f8
util: fix parseEnv handling of invalid lines
PR-URL: https://github.com/nodejs/node/pull/57798
Fixes: https://github.com/nodejs/node/issues/56775
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-04-21 06:46:44 +00:00
Antoine du Hamel
99dc2d376a
tools: add semver-major release support to release-lint
Co-authored-by: RafaelGSS <rafael.nunu@hotmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/57892
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-04-21 06:33:57 +00:00
James M Snell
e773e09c3f
src: fixup errorhandling more in various places
PR-URL: https://github.com/nodejs/node/pull/57852
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-04-21 03:01:30 +00:00
Luigi Pinca
422529a2e3
test: force GC in test-file-write-stream4
Reduce `test/parallel/test-file-write-stream4.js` flakiness.

Refs: https://github.com/nodejs/node/pull/57927
PR-URL: https://github.com/nodejs/node/pull/57930
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-04-20 18:29:12 +00:00
Colin Ihrig
2e0ec72f54
sqlite: add getter to detect transactions
This commit adds an isTransaction getter to the DatabaseSync
class for determining if the database is currently within a
transaction.

Fixes: https://github.com/nodejs/node/issues/57922
PR-URL: https://github.com/nodejs/node/pull/57925
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
2025-04-20 15:57:42 +00:00
Wiyeong Seo
7102ea1559
os: fix netmask format check condition in getCIDR function
Modified to check the format of the netmask instead
of just checking that each part of the netmask is even

PR-URL: https://github.com/nodejs/node/pull/57324
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-04-20 05:54:48 +00:00
Michaël Zasso
25842c5e35
build: use clang-cl in coverage-windows workflow
And do not lose time trying to regenerate the project and rebuild
before running the tests.

PR-URL: https://github.com/nodejs/node/pull/57919
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-04-19 18:00:41 +00:00
fisker Cheung
0699a99bbe
worker: add ESM version examples to worker docs
PR-URL: https://github.com/nodejs/node/pull/57645
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-04-19 17:26:38 +00:00
Kushagra Pandey
609df89cd3 http2: session tracking and graceful server close
This change adds proper tracking of HTTP / 2 server sessions
to ensure they are gracefully closed when the server is
shut down.It implements:

- A new kSessions symbol for tracking active sessions
- Adding/removing sessions from a SafeSet in the server
- A closeAllSessions helper function to close active sessions
- Updates to Http2Server and Http2SecureServer close methods

Breaking Change: any client trying to create new requests
on existing connections will not be able to do so once
server close is initiated

Refs: https://datatracker.ietf.org/doc/html/rfc7540\#section-9.1
Refs: https://nodejs.org/api/http.html\#serverclosecallback

- improve HTTP/2 server shutdown to prevent race conditions

1. Fix server shutdown race condition
   - Stop listening for new connections before closing existing ones
   - Ensure server.close() properly completes in all scenarios

2. Improve HTTP/2 tests
   - Replace setTimeout with event-based flow control
   - Simplify test logic for better readability
   - Add clear state tracking for event ordering
   - Improve assertions to verify correct shutdown sequence

This eliminates a race condition where new sessions could connect
between the time existing sessions are closed and the server stops
listening, potentially preventing the server from fully shutting down.

- fix cross-platform test timing issues

Fix test-http2-server-http1-client.js failure on Ubuntu
by deferring server.close() to next event loop cycle.

The issue only affected Ubuntu where session close occurs
before error emission, causing the test to miss errors
when HTTP/1 clients connect to HTTP/2 servers.

Using setImmediate() ensures error events fire before
server close across all platforms while maintaining
recent session handling improvements.

PR-URL: https://github.com/nodejs/node/pull/57586
Fixes: https://github.com/nodejs/node/issues/57611
Refs: https://datatracker.ietf.org/doc/html/rfc7540#section-9.1
Refs: https://nodejs.org/api/http.html#serverclosecallback
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-04-19 10:17:12 -07:00
Node.js GitHub Bot
e273ddf7a4
deps: update undici to 7.8.0
PR-URL: https://github.com/nodejs/node/pull/57770
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2025-04-19 17:14:51 +00:00
Livia Medeiros
afd318db67
assert: support Float16Array in loose deep equality checks
PR-URL: https://github.com/nodejs/node/pull/57881
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-04-19 17:04:03 +00:00
Vladimir Morozov
c326200458
node-api: convert NewEnv to node_napi_env__::New
PR-URL: https://github.com/nodejs/node/pull/57834
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2025-04-19 17:03:53 +00:00
Kushagra Pandey
2acc8bc6a9
http2: fix graceful session close
Fix issue where session.close() prematurely destroys the session
when response.end() was called with an empty payload while active
http2 streams still existed. This change ensures that sessions are
closed gracefully only after all http2 streams complete and clients
properly receive the GOAWAY frame as per the HTTP/2 spec.

Refs: https://nodejs.org/api/http2.html\#http2sessionclosecallback
PR-URL: https://github.com/nodejs/node/pull/57808
Fixes: https://github.com/nodejs/node/issues/57809
Refs: https://nodejs.org/api/http2.html%5C#http2sessionclosecallback
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-04-19 16:36:03 +00:00
Luigi Pinca
2cff98c853
build: fix missing files warning
This commit fixes the following warning:

    Warning: Missing input files:
    C:\Users\lpinca\node\tools\v8_gypfiles\..\..\deps\v8\third_party\abseil-cpp\absl\strings\internal\has_absl_stringify.h
    C:\Users\lpinca\node\deps\ncrypto\dh-primes.h

https://github.com/nodejs/node/commit/bd3c25cf31282f101196 removed
`'<(ABSEIL_ROOT)/absl/strings/has_absl_stringify.h'` instead of
`'<(ABSEIL_ROOT)/absl/strings/internal/has_absl_stringify.h'`

Refs: https://github.com/nodejs/node/commit/5ab3140dfbf0dfa33a66
Refs: https://github.com/nodejs/node/commit/b9b4cb7731168671d8f4
PR-URL: https://github.com/nodejs/node/pull/57870
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-04-19 15:22:06 +00:00
Ruben Bridgewater
733e0fc2c4
assert,util: fix constructor lookup in deep equal comparison
The latest performance optimization did not take into account that
an object may have a property called constructor. This is addressed
in this PR by adding a new fast path and using fallbacks.

PR-URL: https://github.com/nodejs/node/pull/57876
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-04-19 11:10:40 +00:00
Michaël Zasso
2b76dca0fa
build: remove redundant -mXX flags for V8
They are already set by `common.gypi`.

PR-URL: https://github.com/nodejs/node/pull/57907
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-04-19 10:22:10 +00:00
Edy Silva
63640eb32d
src: fix typo in comments
PR-URL: https://github.com/nodejs/node/pull/57868
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Qingyu Deng <i@ayase-lab.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
2025-04-19 09:33:47 +00:00
Node.js GitHub Bot
52d95f53e4
deps: update zlib to 1.3.0.1-motley-780819f
PR-URL: https://github.com/nodejs/node/pull/57768
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-04-18 13:22:02 +00:00
Shima Ryuhei
6cdcaa9653
test: enable skipped colorize test
PR-URL: https://github.com/nodejs/node/pull/57887
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-04-18 11:08:00 +00:00
Abdirahim Musse
963b24e9a6
process: disable building execve on IBM i
The `execve` syscall does exist on IBM i but
it has caveats that make it not usable in Node.js context.

These changes disable building with `execve` like Windows does.

PR-URL: https://github.com/nodejs/node/pull/57883
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2025-04-18 11:07:51 +00:00
Chengzhong Wu
782c2e0fe4
doc: mark devtools integration section as active development
This marks the whole devtools integration section as in active
development.

PR-URL: https://github.com/nodejs/node/pull/57886
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-04-17 19:38:57 +00:00
Attila Szegedi
ffb9bfb206
src: add ExecutionAsyncId getter for any Context
Adds a variant of AsyncHooksGetExecutionAsyncId that takes a V8 Context
and returns the async ID belonging to the Environment (if any) of that
Context. Sometimes we want to use Isolate::GetEnteredOrMicrotaskContext
insteads of Isolate::GetCurrentContext (e.g. recording the async ID in
a V8 GC prologue callback) when current context is not set.

PR-URL: https://github.com/nodejs/node/pull/57820
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2025-04-17 18:00:05 +00:00
Gürgün Dayıoğlu
9d6626a37e
lib: fix AbortSignal.any() with timeout signals
PR-URL: https://github.com/nodejs/node/pull/57867
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-04-17 14:28:36 +00:00
Shima Ryuhei
d8e9e05a27
util: fix formatting of objects with built-in Symbol.toPrimitive
Fixes: https://github.com/nodejs/node/issues/57818
PR-URL: https://github.com/nodejs/node/pull/57832
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-04-17 13:35:56 +00:00
Matteo Collina
33d8e03d9d
worker: add worker.getHeapStatistics()
Adds worker.getHeapStatistics() so that the heap usage of the worker
could be observer from the parent thread.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/57888
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2025-04-17 10:30:59 +00:00
Livia Medeiros
c11c7be36e
crypto: forbid passing Float16Array to getRandomValues()
PR-URL: https://github.com/nodejs/node/pull/57880
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2025-04-17 07:26:53 +00:00
Livia Medeiros
e61937b82c
util: add types.isFloat16Array()
PR-URL: https://github.com/nodejs/node/pull/57879
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-04-16 22:09:02 +00:00
Node.js GitHub Bot
02edc31367
deps: update timezone to 2025b
PR-URL: https://github.com/nodejs/node/pull/57857
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-04-16 22:08:52 +00:00
Pietro Marchini
cb5f671a34
test_runner: add global setup and teardown functionality
PR-URL: https://github.com/nodejs/node/pull/57438
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-04-16 17:51:06 +00:00
Aditi
e800f009f6
src: update std::vector<v8::Local<T>> to use v8::LocalVector<T>
Refs: https://github.com/nodejs/node/pull/57578
PR-URL: https://github.com/nodejs/node/pull/57646
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-04-16 16:59:07 +00:00
Aditi
ad3e835421
src: update std::vector<v8::Local<T>> to use v8::LocalVector<T>
A follow up of https://github.com/nodejs/node/pull/57578 to
replace all std::vector<v8::Local<T>> to use v8::LocalVector<T>

PR-URL: https://github.com/nodejs/node/pull/57642
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-04-16 16:58:55 +00:00
Aditi
e74e065662
src: update std::vector<v8::Local<T>> to use v8::LocalVector<T>
According to V8's public API documentation, local handles
(i.e., objects of type v8::Local<T>) "should never be allocated
on the heap". This replaces the usage of heap-allocated data
structures containing instances of `v8::Local`, specifically the
`std::vector<v8::Local<v8::String>>` with recently
introduced `v8::LocalVector<T>`.

This is first of the series of commits to replace all
`std::vector<v8::Local<T>>` to use `v8::LocalVector<T>`.

PR-URL: https://github.com/nodejs/node/pull/57578
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-04-16 16:58:44 +00:00
Pietro Marchini
8e4e4df91a
test_runner: recalculate run duration on watch restart
PR-URL: https://github.com/nodejs/node/pull/57786
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-04-16 15:38:50 +00:00
Giovanni Bucci
af85f3f169
repl: fix multiline history editing string order
PR-URL: https://github.com/nodejs/node/pull/57874
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-04-16 15:01:38 +00:00
Node.js GitHub Bot
5077ea4149
deps: update amaro to 0.5.2
PR-URL: https://github.com/nodejs/node/pull/57871
Fixes: https://github.com/nodejs/node/issues/57471
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
2025-04-16 10:34:19 +00:00
Gürgün Dayıoğlu
4b2b3c01b4
stream: preserve AsyncLocalStorage context in finished()
PR-URL: https://github.com/nodejs/node/pull/57865
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-04-16 09:27:37 +00:00
Node.js GitHub Bot
91d8a524ad
deps: update simdutf to 6.4.2
PR-URL: https://github.com/nodejs/node/pull/57855
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-04-15 13:56:21 +00:00
Alex Schwartz
c9c61a3a7d
doc: fix typo in module.md
PR-URL: https://github.com/nodejs/node/pull/57889
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Qingyu Deng <i@ayase-lab.com>
2025-04-15 14:42:38 +02:00
Tobias Nießen
0a1d5d353b
crypto: revert dangerous uses of std::string_view
An `std::string_view v` is a `const char* v.data()` along with an
`std::size_t v.size()` that guarantees that `v.size()` contiguous
elements of type `char` can be accessed relative to the pointer
`v.data()`.

One of the main reasons behind the existence of  `std::string_view` is
the ability to operate on `char` sequences without requiring null
termination, which otherwise often requires expensive copies of strings
to be made. As a consequence, it is generally incorrect to assume that
`v.data()` points to a null-terminated sequence of `char`, and the only
way to obtain a null-terminated string from an `std::string_view` is to
make a copy. It is not even possible to check if the sequence pointed to
by `v.data()` is null-terminated because the null character would be at
position `v.data() + v.size()`, which is outside of the range that `v`
guarantees safe access to. (A default-constructed `std::string_view`
even sets its own data pointer to a `nullptr`, which is fine because it
only needs to guarantee safe access to zero elements, i.e., to no
elements).

In `deps/ncrypto` and `src/crypto`, there are various APIs that consume
`std::string_view v` arguments but then ignore `v.size()` and treat
`v.data()` as a C-style string of type `const char*`. However, that is
not what call sites would expect from functions that explicitly ask for
`std::string_view` arguments, since it makes assumptions beyond the
guarantees provided by `std::string_view` and leads to undefined
behavior unless the given view either contains an embedded null
character or the `char` at address `v.data() + v.size()` is a null
character. This is not a reasonable assumption for `std::string_view` in
general, and it also defeats the purpose of `std::string_view` for the
most part since, when `v.size()` is being ignored, it is essentially
just a `const char*`.

Constructing an `std::string_view` from a `const char*` is also not
"free" but requires computing the length of the C-style string (unless
the length can be computed at compile time, e.g., because the value is
just a string literal). Repeated conversion between `const char*` as
used by OpenSSL and `std::string_view` as used by ncrypto thus incurs
the additional overhead of computing the length of the string whenever
an `std::string_view` is constructed from a `const char*`. (This seems
negligible compared to the safety argument though.)

Similarly, returning a `const char*` pointer to a C-style string as an
`std::string_view` has two downsides: the function must compute the
length of the string in order to construct the view, and the caller
can no longer assume that the return value is null-terminated and thus
cannot pass the returned view to functions that require their arguments
to be null terminated. (And, for the reasons explained above, the caller
also cannot check if the value is null-terminated without potentially
invoking undefined behavior.)

C++20 unfortunately does not have a type similar to Rust's `CStr` or
GSL `czstring`. Therefore, this commit changes many occurrences of
`std::string_view` back to `const char*`, which is conventional for
null-terminated C-style strings and does not require computing the
length of strings.

There are _a lot_ of occurrences of `std::string_view` in ncrypto and
for each one, we need to evaluate if it is safe and a good abstraction.
I tried to do so, but I might have changed too few or too many, so
please feel free to give feedback on individual occurrences.

PR-URL: https://github.com/nodejs/node/pull/57816
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2025-04-15 12:09:22 +00:00
Node.js GitHub Bot
2204587d76
test: update WPT for WebCryptoAPI to 164426ace2
PR-URL: https://github.com/nodejs/node/pull/57854
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-04-15 01:04:25 +00:00
Joyee Cheung
b2405e9b07 src: migrate from deprecated SnapshotCreator constructor
Previously we have been using the variant of SnapshotCreator that
only passes the external references instead of
v8::Isolate::CreateParams and it's about to be deprecated.
Switch to using the new constructor that takes a fully CreateParams
instead.

This also makes sure that the snapshot building script is using
the Node.js array buffer allocator instead of a separate default
one that was previously used by the old constructor. The zero fill
toggle in the Node.js array buffer allocator would still be ignored
during snapshot building, however, until we fixes the array buffer
allocator and let V8 own the toggle backing store instead, because
otherwise the snapshot would contain the external toggle address
and become unreproducible.

PR-URL: https://github.com/nodejs/node/pull/55337
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-04-14 12:11:43 -07:00
Dario Piotrowicz
11bb7cdb07 doc: increase z-index of header element
increase the z-index of the header element to make sure that
opened pickers from it (such as the node version picker) are
on top of other content

PR-URL: https://github.com/nodejs/node/pull/57851
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-04-14 12:01:54 -07:00
Rafael Gonzaga
78fd82b77b
tools: add codeql nightly
Refs: https://github.com/nodejs/node/pull/57535
PR-URL: https://github.com/nodejs/node/pull/57788
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-04-14 17:22:32 +00:00
Shima Ryuhei
f89baf2e2a
test_runner: match minimum file column to 'all files'
PR-URL: https://github.com/nodejs/node/pull/57848
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2025-04-14 13:40:19 +00:00
Elves Vieira
958fd912d5
tools: edit create-release-proposal workflow to handle pr body length
PR-URL: https://github.com/nodejs/node/pull/57841
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-04-14 12:54:17 +00:00
Trivikram Kamat
004ecc12eb
doc: clarify future Corepack removal in v25+
PR-URL: https://github.com/nodejs/node/pull/57825
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-04-14 03:25:03 +00:00
Tobias Nießen
29af9cea7f
crypto: fix misleading positional argument
The fourth positional argument of `createCipherBase` is `true` when
called from within the `Cipheriv` constructor and `false`when called
from within the `Decipheriv` constructor. This value is then passed to
the `CipherBase::New()` method, which treats it as follows:

    args[0]->IsTrue() ? kCipher : kDecipher

However, the current name of said positional argument is `decipher` and
thus indicates the exact opposite: when the argument is set to true, the
instance is *not* a `Decipheriv` object. Therefore, this commit renames
the argument to `isEncrypt`, which matches the actual semantics.

PR-URL: https://github.com/nodejs/node/pull/57843
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-04-13 23:22:02 +00:00