Commit Graph

4636 Commits

Author SHA1 Message Date
Antoine du Hamel
2079a7aec4
module: do not set CJS variables for Worker eval
PR-URL: https://github.com/nodejs/node/pull/53050
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-05-25 02:51:47 +00:00
jakecastelli
c7a63b0740
watch: fix variable naming
PR-URL: https://github.com/nodejs/node/pull/53101
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2024-05-24 05:31:05 +00:00
Michaël Zasso
7e6d92c485
tools: update ESLint to v9 and use flat config
Closes: https://github.com/nodejs/node/issues/52567
PR-URL: https://github.com/nodejs/node/pull/52780
Fixes: https://github.com/nodejs/node/issues/52567
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-05-23 19:45:18 +00:00
Colin Ihrig
f9a09131d7
test_runner: fix t.assert methods
The node:assert module contains several top level APIs that do
not make sense to expose as methods on t.assert. Examples include
AssertionError and CallTracker. This commit removes such APIs from
t.assert.

Refs: https://github.com/nodejs/node/pull/52860
PR-URL: https://github.com/nodejs/node/pull/53049
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-05-20 16:49:15 +00:00
Colin Ihrig
a619789ef0
test_runner: support module mocking
This commit adds experimental module mocking to the test runner.

PR-URL: https://github.com/nodejs/node/pull/52848
Fixes: https://github.com/nodejs/node/issues/51164
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2024-05-19 05:09:09 +00:00
Tobias Nießen
559212e64c
tls: fix negative sessionTimeout handling
For historical reasons, the second argument of SSL_CTX_set_timeout is a
signed integer, and Node.js has so far passed arbitrary (signed) int32_t
values. However, new versions of OpenSSL have changed the handling of
negative values inside SSL_CTX_set_timeout, and we should shield users
of Node.js from both the old and the new behavior. Hence, reject any
negative values by throwing an error from within createSecureContext.

Refs: https://github.com/openssl/openssl/pull/19082
PR-URL: https://github.com/nodejs/node/pull/53002
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
2024-05-18 00:26:11 +00:00
Moshe Atlow
d4442a93e2
test_runner: avoid error when coverage line not found
PR-URL: https://github.com/nodejs/node/pull/53000
Fixes: https://github.com/nodejs/node/issues/52775
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
2024-05-17 08:46:52 +00:00
Michaël Zasso
fac55e3ef9
lib,doc: replace references to import assertions
Use "import attributes" and "type attribute" instead.

PR-URL: https://github.com/nodejs/node/pull/52998
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2024-05-17 08:07:48 +00:00
Moshe Atlow
c1657510b5
test_runner: fix watch mode race condition
PR-URL: https://github.com/nodejs/node/pull/52954
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2024-05-14 08:31:02 +00:00
Aras Abbasi
1d7d094a98
lib: add EventSource Client
PR-URL: https://github.com/nodejs/node/pull/51575
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-05-13 05:32:08 +00:00
Zhenwei Jin
c8a4f70265
assert: add deep equal check for more Error type
PR-URL: https://github.com/nodejs/node/pull/51805
Fixes: https://github.com/nodejs/node/issues/51793
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-05-12 19:46:13 +00:00
Jacob Hummer
c7d53f0169
bootstrap: print --help message using console.log
PR-URL: https://github.com/nodejs/node/pull/51463
Fixes: https://github.com/nodejs/node/issues/51448
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2024-05-12 21:43:13 +02:00
Mustafa Ateş UZUN
2b57e47d42
crypto: fix duplicated switch-case return values
PR-URL: https://github.com/nodejs/node/pull/49030
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-05-12 21:17:14 +02:00
sinkhaha
c0a6320a48
events: update MaxListenersExceededWarning message log
PR-URL: https://github.com/nodejs/node/pull/51921
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-05-12 18:16:09 +00:00
Khafra
e2697c1a64
perf_hooks: add deliveryType and responseStatus fields
PR-URL: https://github.com/nodejs/node/pull/51589
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-05-12 20:02:48 +02:00
Jérôme Benoit
7b2dc79437
cluster: replace forEach with for-of loop
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
PR-URL: https://github.com/nodejs/node/pull/50317
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-05-12 19:58:40 +02:00
Jason
261e88e269
stream: use ByteLengthQueuingStrategy when not in objectMode
Fixes: https://github.com/nodejs/node/issues/46347
PR-URL: https://github.com/nodejs/node/pull/48847
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-05-12 19:24:43 +02:00
Chenyu Yang
dde2965765
util: fix %s format behavior with Symbol.toPrimitive
This commit ensures `console.log("%s", obj)` correctly invokes
`obj[Symbol.toPrimitive]` for string conversion, fixing unexpected
object display issue.

PR-URL: https://github.com/nodejs/node/pull/50992
Fixes: https://github.com/nodejs/node/issues/50909
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
2024-05-12 12:37:31 +02:00
linkgoron
12232946c0
repl: fix disruptive autocomplete without inspector
Fix an issue where the autocomplete wrongly autocompletes
a value from a correct value to an undefined value when `node`
is built without an inspector by disabling the preview view.

fixes: https://github.com/nodejs/node/issues/40635
PR-URL: https://github.com/nodejs/node/pull/40661
Fixes: https://github.com/nodejs/node/issues/40635
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-05-12 11:15:25 +02:00
Matthieu Sieben
c75675c726
watch: allow listening for grouped changes
PR-URL: https://github.com/nodejs/node/pull/52722
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-05-12 07:43:38 +00:00
Mert Can Altin
cd155d6454
stream: fix util.inspect for compression/decompressionStream
PR-URL: https://github.com/nodejs/node/pull/52283
Fixes: https://github.com/nodejs/node/issues/52263
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-05-12 09:38:40 +02:00
Mickael Meausoone
04cf8c2130
events: add stop propagation flag to Event.stopImmediatePropagation
Spec mention stopImmediatePropagation should set both flags:
"stop propagation" and "stop immediate propagation".
So the second is not supported by Node.js as there is no
hierarchy and bubbling,
but the flags are both present as well as stopPropagation.
It would makes sense to follow specs on that.

Refs: https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation
PR-URL: https://github.com/nodejs/node/pull/39463
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2024-05-12 09:18:03 +02:00
Feng Yu
bd323b62ea
events: replace NodeCustomEvent with CustomEvent
PR-URL: https://github.com/nodejs/node/pull/43876
Refs: https://github.com/nodejs/node/pull/43514
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2024-05-11 20:43:06 +02:00
Zhenwei Jin
ff7910b693
fs: keep fs.promises.readFile read until EOF is reached
PR-URL: https://github.com/nodejs/node/pull/52178
Fixes: https://github.com/nodejs/node/issues/52155
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-05-11 15:39:21 +00:00
Zack
70995bde61
watch: enable passthrough ipc in watch mode
PR-URL: https://github.com/nodejs/node/pull/50890
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2024-05-09 18:56:30 +00:00
Colin Ihrig
0c83f80ff3 test_runner: support test plans
Co-Authored-By: Marco Ippolito <marcoippolito54@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/52860
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2024-05-09 12:09:09 +02:00
Joyee Cheung
2863c54257 module: cache synchronous module jobs before linking
So that if there are circular dependencies in the synchronous
module graph, they could be resolved using the cached jobs.
In case linking fails and the error gets caught, reset the
cache right after linking. If it succeeds, the caller will
cache it again. Otherwise the error bubbles up to users,
and since we unset the cache for the unlinkable module
the next attempt would still fail.

PR-URL: https://github.com/nodejs/node/pull/52868
Fixes: https://github.com/nodejs/node/issues/52864
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-05-09 00:25:14 +00:00
Jithil P Ponnan
a833c9e0be
console: colorize console error and warn
prints console error in red and warn in yellow

PR-URL: https://github.com/nodejs/node/pull/51629
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Ruy Adorno <ruy@vlt.sh>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-05-08 23:57:26 +10:00
Gabriel Bota
22cb99d073
module: have a single hooks thread for all workers
PR-URL: https://github.com/nodejs/node/pull/52706
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2024-05-08 02:20:48 +00:00
Rafael Gonzaga
951af83033
lib,src: remove --experimental-policy
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/52583
Refs: https://github.com/nodejs/node/issues/52575
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-05-07 16:25:45 +00:00
Mihir Bhansali
69f2acea40
test_runner: display failed test stack trace with dot reporter
PR-URL: https://github.com/nodejs/node/pull/52655
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2024-05-07 14:30:25 +03:00
Aviv Keller
303c80c50b
fs: allow 'withFileTypes' to be used with globs
PR-URL: https://github.com/nodejs/node/pull/52837
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2024-05-07 11:12:42 +00:00
Aras Abbasi
be8d64ec14
process: improve event-loop
PR-URL: https://github.com/nodejs/node/pull/52108
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2024-05-06 20:16:22 +00:00
Livia Medeiros
f202322ea4
fs: adjust typecheck for type in fs.symlink()
Throws `TypeError` instead of `Error`
Enables autodetection on Windows if `type === undefined`
Explicitly disallows unknown strings and non-string values

PR-URL: https://github.com/nodejs/node/pull/49741
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2024-05-06 13:18:42 +00:00
Zhenwei Jin
bf8afe7644
buffer: remove lines setting indexes to integer value
PR-URL: https://github.com/nodejs/node/pull/52588
Refs: https://github.com/nodejs/node/issues/52585
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-05-06 12:45:31 +00:00
uzlopak
b77f32bd7e
util: improve isInsideNodeModules
PR-URL: https://github.com/nodejs/node/pull/52147
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-05-05 11:56:39 +02:00
Antoine du Hamel
15e7563062
fs: runtime deprecate dirent.path
PR-URL: https://github.com/nodejs/node/pull/51050
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2024-05-05 09:45:20 +00:00
Moshe Atlow
44287af42b
test_runner: preserve hook promise when executed twice
PR-URL: https://github.com/nodejs/node/pull/52791
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2024-05-04 22:55:50 +00:00
Rafael Gonzaga
15456e4e57
src,permission: resolve path on fs_permission
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/52761
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2024-05-03 03:40:49 +00:00
Joyee Cheung
a480e52b6e
src: reduce unnecessary serialization of CLI options in C++
In this patch we split the serialization routine into two different
routines: `getCLIOptionsValues()` for only serializing the key-value
pairs and `getCLIOptionsInfo()` for getting additional information such
as help text etc. The former is used a lot more frequently than the
latter, which is only used for generating `--help` and building
`process.allowedNodeEnvironmentFlags`.

`getCLIOptionsValues()` also adds `--no-` entries for boolean options so
there is no need to special case in the JS land.
This patch also refactors the option serialization routines to
use v8::Object constructor that takes key-value pairs in one go
to avoid calling Map::Set or Object::Set repeatedly which can go
up to a patched prototype.

PR-URL: https://github.com/nodejs/node/pull/52451
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-05-02 22:57:03 +00:00
Yagiz Nizipli
c5cfdd4849
src: rewrite task runner in c++
PR-URL: https://github.com/nodejs/node/pull/52609
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2024-05-02 19:54:02 +00:00
Moshe Atlow
905ab3e9ec
watch: fix arguments parsing
PR-URL: https://github.com/nodejs/node/pull/52760
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
2024-05-02 18:45:40 +00:00
Joyee Cheung
4d59a9deda
module: support ESM detection in the CJS loader
This patch:

1. Adds ESM syntax detection to compileFunctionForCJSLoader()
  for --experimental-detect-module and allow it to emit the
  warning for how to load ESM when it's used to parse ESM as
  CJS but detection is not enabled.
2. Moves the ESM detection of --experimental-detect-module for
  the entrypoint from executeUserEntryPoint() into
  Module.prototype._compile() and handle it directly in the
  CJS loader so that the errors thrown during compilation *and
  execution* during the loading of the entrypoint does not
  need to be bubbled all the way up. If the entrypoint doesn't
  parse as CJS, and detection is enabled, the CJS loader will
  re-load the entrypoint as ESM on the spot asynchronously using
  runEntryPointWithESMLoader() and cascadedLoader.import(). This
  is fine for the entrypoint because unlike require(ESM) we don't
  the namespace of the entrypoint synchronously, and can just
  ignore the returned value. In this case process.mainModule is
  reset to undefined as they are not available for ESM entrypoints.
3. Supports --experimental-detect-module for require(esm).

PR-URL: https://github.com/nodejs/node/pull/52047
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-04-29 20:21:53 +00:00
Daeyeon Jeong
f7e73cd1f2
cli: remove --no-experimental-global-customevent flag
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/52723
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
2024-04-29 15:15:40 +00:00
Khafra
3136fb0c28
lib: replace MessageEvent with undici's
undici's MessageEvent is better tested and has a complete WebIDL
implementation for validation. Not only this, but it's also used in
Node's  current WebSocket implementation. There are a large number of
webidl-related issues in the current MessageEvent, such as not
implementing `MessageEvent.prototype.initMessageEvent`, not validating
arguments passed to its constructor
(https://github.com/nodejs/node/pull/51771), not validating the values
passed to the constructor (such as not validating that `ports` is a
sequence, not converting origin to a USVString, etc.), and other issues.

fixup

PR-URL: https://github.com/nodejs/node/pull/52370
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2024-04-29 11:05:57 +00:00
Eugene
2bdd670882
http2: fix excessive CPU usage when using allowHTTP1=true
When Http2SecureServer is configured with `allowHTTP1=true`, it calls
`setupConnectionsTracking` to start monitoring for idle HTTP1
connections. `setupConnectionsTracking` expects to have
`this.connectionsCheckingInterval` property defined, but it does not
exist on `Http2SecureServer`. This `undefined` value is passed to
`setInterval`, which results in `checkConnections` being called on
every tick, creating significant additional load on the server CPU.
The fix is to define `this.connectionsCheckingInterval` on the
Http2SecureServer instance.

Refs: https://github.com/nodejs/node/pull/51569
PR-URL: https://github.com/nodejs/node/pull/52713
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-04-28 19:18:07 +00:00
Mattias Buelens
eee9db8b8e
stream: update ongoing promise in async iterator return() method
PR-URL: https://github.com/nodejs/node/pull/52657
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-04-28 16:51:44 +00:00
Nicolò Ribaudo
1aab22e305
fs: allow setting Stat date properties
PR-URL: https://github.com/nodejs/node/pull/52708
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-04-28 13:39:35 +00:00
Aviv Keller
172820342b
vm: fix ASCII-betical order
PR-URL: https://github.com/nodejs/node/pull/52686
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-04-25 19:14:16 +00:00
Chengzhong Wu
d5c7ffd7b6
lib,src: iterate module requests of a module wrap in JS
Avoid repetitively calling into JS callback from C++ in
`ModuleWrap::Link`. This removes the convoluted callback style of the
internal `ModuleWrap` link step.

PR-URL: https://github.com/nodejs/node/pull/52058
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2024-04-25 10:33:15 +00:00