Maël Nison
b7d836e2c7
lib: reset the cwd cache before execution
...
PR-URL: https://github.com/nodejs/node/pull/49684
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2023-09-21 16:56:33 +00:00
Jungku Lee
fa741580ab
doc: add missing function call to example for util.promisify
...
PR-URL: https://github.com/nodejs/node/pull/49719
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2023-09-21 14:59:33 +00:00
Deokjin Kim
05ebb8eda6
doc: update output of example in mimeParams.set()
...
Actual output of example in `mimeParams.set()` is mismatched.
PR-URL: https://github.com/nodejs/node/pull/49718
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-09-21 14:14:17 +00:00
Daniel X Moore
f7414a8b8e
repl: don't accumulate excess indentation in .load
...
When using .load the REPL would accumulate indentation with each line
including the indentation from all previous lines. Now it keeps the
indentation at the correct level.
Fixes: https://github.com/nodejs/node/issues/47673
PR-URL: https://github.com/nodejs/node/pull/49461
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com >
2023-09-21 13:37:41 +00:00
Deokjin Kim
485882632b
doc: add missed inspect with numericSeparator to example
...
In exmple of `util.inspect` with numericSeparator option,
calling `util.inspect` is missed. So actual result is different
from expected result.
PR-URL: https://github.com/nodejs/node/pull/49717
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2023-09-21 13:03:23 +00:00
Filip Skokan
718a1cf0ce
test,crypto: update WebCryptoAPI WPT
...
PR-URL: https://github.com/nodejs/node/pull/49714
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-09-21 09:02:11 +00:00
Luigi Pinca
480ab8c3a4
Revert "test: mark test-http-regr-gh-2928 as flaky"
...
This reverts commit 48fcb205e4 .
Refs: https://github.com/nodejs/node/commit/18e00a577d74
PR-URL: https://github.com/nodejs/node/pull/49708
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com >
2023-09-20 18:31:47 +00:00
Antoine du Hamel
b64f620a19
doc: fix history comments
...
PR-URL: https://github.com/nodejs/node/pull/49701
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2023-09-20 12:40:54 +00:00
Antoine du Hamel
fd1406320d
doc: add missing history info for import.meta.resolve
...
PR-URL: https://github.com/nodejs/node/pull/49700
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Jacob Smith <jacob@frende.me >
2023-09-20 12:25:06 +00:00
Antoine du Hamel
20b996dcf1
esm: fix return type of import.meta.resolve
...
PR-URL: https://github.com/nodejs/node/pull/49698
Fixes: https://github.com/nodejs/node/issues/49695
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
2023-09-20 10:09:15 +00:00
Livia Medeiros
cdad3d8fe5
test: use fs.constants for fs.access constants
...
PR-URL: https://github.com/nodejs/node/pull/49685
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-09-20 07:14:37 +00:00
Raz Luvaton
346abdd060
stream: improve readable webstream pipeTo
...
PR-URL: https://github.com/nodejs/node/pull/49690
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2023-09-19 19:22:06 +00:00
Marco Ippolito
1149d6b49d
doc: link maintaining deps to pull-request.md
...
PR-URL: https://github.com/nodejs/node/pull/49716
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2023-09-19 17:49:16 +00:00
Jungku Lee
f72784b7e3
doc: fix print results in events
...
PR-URL: https://github.com/nodejs/node/pull/49548
Refs: https://github.com/nodejs/node/issues/49537
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2023-09-19 17:31:09 +00:00
Debadree Chatterjee
cd97e28860
benchmark: add a benchmark for read() of ReadableStreams
...
Refs: https://github.com/nodejs/performance/issues/82
PR-URL: https://github.com/nodejs/node/pull/49622
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2023-09-19 10:54:32 +00:00
Michael Dawson
2ccfb23b7f
tools: fix uvwasi updater
...
- fix uvwasi updater to update the right dep in the
documentation for maintaining dependencies.
Signed-off-by: Michael Dawson <mdawson@devrus.com >
PR-URL: https://github.com/nodejs/node/pull/49682
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-09-19 08:15:23 +00:00
Geoffrey Booth
f91b4e2bf0
esm: update loaders warning
...
PR-URL: https://github.com/nodejs/node/pull/49633
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
2023-09-19 03:59:50 +00:00
Geoffrey Booth
7517c9f95b
module, esm: jsdoc for modules files
...
PR-URL: https://github.com/nodejs/node/pull/49523
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2023-09-19 02:48:24 +00:00
Node.js GitHub Bot
d847895b8d
tools: update lint-md-dependencies to rollup@3.29.2
...
PR-URL: https://github.com/nodejs/node/pull/49679
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2023-09-19 00:30:52 +00:00
Ruy Adorno
78ab0eebd1
2023-09-18, Version 18.18.0 'Hydrogen' (LTS)
...
Notable changes:
build:
* sync libuv header change (Jiawen Geng) https://github.com/nodejs/node/pull/48078
crypto:
* update root certificates to NSS 3.93 (Node.js GitHub Bot) https://github.com/nodejs/node/pull/49341
* update root certificates to NSS 3.90 (Node.js GitHub Bot) https://github.com/nodejs/node/pull/48416
deps:
* add missing thread-common.c in uv.gyp (Santiago Gimeno) https://github.com/nodejs/node/pull/48078
* upgrade to libuv 1.46.0 (Santiago Gimeno) https://github.com/nodejs/node/pull/48078
* upgrade to libuv 1.45.0 (Santiago Gimeno) https://github.com/nodejs/node/pull/48078
doc:
* add atlowChemi to collaborators (atlowChemi) https://github.com/nodejs/node/pull/48757
* add vmoroz to collaborators (Vladimir Morozov) https://github.com/nodejs/node/pull/48527
* add kvakil to collaborators (Keyhan Vakil) https://github.com/nodejs/node/pull/48449
esm:
* (SEMVER-MINOR) add `--import` flag (Moshe Atlow) https://github.com/nodejs/node/pull/43942
events:
* (SEMVER-MINOR) allow safely adding listener to abortSignal (Chemi Atlow) https://github.com/nodejs/node/pull/48596
fs, stream:
* initial `Symbol.dispose` and `Symbol.asyncDispose` support (Moshe Atlow) https://github.com/nodejs/node/pull/48518
net:
* add autoSelectFamily global getter and setter (Paolo Insogna) https://github.com/nodejs/node/pull/45777
url:
* (SEMVER-MINOR) add value argument to has and delete methods (Sankalp Shubham) https://github.com/nodejs/node/pull/47885
PR-URL: https://github.com/nodejs/node/pull/49220
2023-09-18 17:39:17 -04:00
Joyee Cheung
9322bcd683
test: use checkIfCollectable in vm leak tests
...
Previously we simply create a lot of the target objects and check
if the process crash due to OOM. Due to how we use emphemeron GC
to handle memory management, which is inefficient but necessary
for correctness, the tests can produce false positives as
the GC isn't efficient enough to catch up with a very fast
heap growth.
This patch uses a new checkIfCollectable() utility to terminate the
test early once we detect that any of the target object can actually
be garbage collected. This should lower the chance of false positives.
As a drive-by this also allows us to use setImmediate() to grow the
heap even faster to make the tests run faster.
PR-URL: https://github.com/nodejs/node/pull/49671
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2023-09-18 23:00:53 +02:00
Joyee Cheung
18eaf03f0c
test: add checkIfCollectable to test/common/gc.js
...
PR-URL: https://github.com/nodejs/node/pull/49671
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2023-09-18 23:00:52 +02:00
Luigi Pinca
18e00a577d
test: deflake test-http-regr-gh-2928
...
Hard code the value of the host parameter to `common.localhostIPv4` in
`server.listen()` and `net.connect()`. This
1. ensures that the client `socket._handle` is not reinitialized during
connection due to the family autodetection algorithm, preventing
`parser.consume()` from being called with an invalid `socket._handle`
parameter.
2. works around an issue in the FreeBSD 12 machine where the stress test
is run where some sockets get stuck after connection.
PR-URL: https://github.com/nodejs/node/pull/49574
Closes: https://github.com/nodejs/node/pull/49565
Fixes: https://github.com/nodejs/node/issues/49564
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-09-18 20:16:24 +02:00
Ulises Gascón
b651e37d2e
2023-09-18, Version 20.7.0 (Current)
...
Notable changes:
crypto:
* update root certificates to NSS 3.93 (Node.js GitHub Bot) https://github.com/nodejs/node/pull/49341
deps:
* upgrade npm to 10.1.0 (npm team) https://github.com/nodejs/node/pull/49570
* upgrade npm to 10.0.0 (npm team) https://github.com/nodejs/node/pull/49423
doc:
* move and rename loaders section (Geoffrey Booth) https://github.com/nodejs/node/pull/49261
* add release key for Ulises Gascon (Ulises Gascón) https://github.com/nodejs/node/pull/49196
lib:
* (SEMVER-MINOR) add api to detect whether source-maps are enabled (翠 / green) https://github.com/nodejs/node/pull/46391
src:
* support multiple `--env-file` declarations (Yagiz Nizipli) https://github.com/nodejs/node/pull/49542
src,permission:
* add multiple allow-fs-* flags (Carlos Espa) https://github.com/nodejs/node/pull/49047
test_runner:
* (SEMVER-MINOR) expose location of tests (Colin Ihrig) https://github.com/nodejs/node/pull/48975
PR-URL: https://github.com/nodejs/node/pull/49592
2023-09-18 17:36:24 +00:00
Raz Luvaton
5c39ee6f87
stream: improve webstream readable async iterator performance
...
PR-URL: https://github.com/nodejs/node/pull/49662
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2023-09-18 14:17:39 +00:00
Joyee Cheung
b03a757619
src: use SNAPSHOT_SERDES to log snapshot ser/deserialization
...
To avoid clobbering output of MKSNAPSHOT
PR-URL: https://github.com/nodejs/node/pull/49637
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-09-18 12:32:40 +00:00
Antoine du Hamel
ccca547e28
util: runtime deprecate promisify-ing a function returning a Promise
...
PR-URL: https://github.com/nodejs/node/pull/49609
Fixes: https://github.com/nodejs/node/issues/49607
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-09-18 10:29:13 +00:00
Geoff Goodman
553169f19a
src: port Pipe to uv_pipe_bind2, uv_pipe_connect2
...
The introduction of the uv_pipe_bind2 and uv_pipe_connect2 methods in
libuv v1.46.0 changed the behaviour of uv_pipe_bind and uv_pipe_connect.
This broke the ability to connect to abstract domain sockets on linux.
This change ports PipeWrap to use the new uv_pipe_bind2 and
uv_pipe_connect2 methods to restore abstract domain socket support.
Fixes: https://github.com/nodejs/node/issues/49656
Refs: https://github.com/libuv/libuv/pull/4030
PR-URL: https://github.com/nodejs/node/pull/49667
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-09-18 07:11:22 +00:00
Joyee Cheung
1995eca29b
build: run embedtest using node executable
...
We should use the node executable to run this test, instead of
counting on embedtest, the binary being tested, as the test runner.
Otherwise bugs can go unnoticed if the embedtest binary itself
does not work correctly.
PR-URL: https://github.com/nodejs/node/pull/49506
Fixes: https://github.com/nodejs/node/issues/49501
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-09-18 00:06:20 +02:00
Joyee Cheung
76ac548477
test: fix argument computation in embedtest
...
There were a few bugs in the original test that went unnoticed
because with the bug the test did not actually get run anymore.
This patch fixes the argument computation by accounting filtering
of the arguments, and uses spawnSyncAndExit{WithoutError} in
the test to enable better logging when the test fails.
PR-URL: https://github.com/nodejs/node/pull/49506
Fixes: https://github.com/nodejs/node/issues/49501
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-09-18 00:06:20 +02:00
Joyee Cheung
07e8539347
bootstrap: do not expand argv1 for snapshots
...
To avoid capturing build machine states into the snapshot
PR-URL: https://github.com/nodejs/node/pull/49506
Fixes: https://github.com/nodejs/node/issues/49501
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-09-18 00:06:20 +02:00
Geoffrey Booth
cdcb01a144
doc: alphabetize cli.md sections
...
PR-URL: https://github.com/nodejs/node/pull/49668
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Harshitha K P <harshitha014@gmail.com >
2023-09-17 22:00:10 +00:00
Geoffrey Booth
a71e3a65bb
test: fix edge snapshot stack traces
...
PR-URL: https://github.com/nodejs/node/pull/49659
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2023-09-17 20:59:41 +00:00
Yagiz Nizipli
7e12d0e16d
fs: improve error performance of sync methods
...
PR-URL: https://github.com/nodejs/node/pull/49593
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
2023-09-17 20:42:46 +00:00
Node.js GitHub Bot
c177ac0a7d
deps: update nghttp2 to 1.56.0
...
PR-URL: https://github.com/nodejs/node/pull/49582
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-09-17 18:22:51 +00:00
Michaël Zasso
36ab510da7
src: remove unused variable
...
PR-URL: https://github.com/nodejs/node/pull/49665
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
2023-09-17 13:03:14 +00:00
Antoine du Hamel
56ecf29283
esm: fix support for URL instances in register
...
PR-URL: https://github.com/nodejs/node/pull/49655
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-09-17 00:48:48 +00:00
Paolo Insogna
e9ff81016d
deps: update llhttp to 9.1.2
...
PR-URL: https://github.com/nodejs/node/pull/48981
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2023-09-16 11:08:18 +00:00
Antoine du Hamel
71b90faac0
doc: deprecate calling promisify on a function that returns a promise
...
PR-URL: https://github.com/nodejs/node/pull/49647
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2023-09-16 09:55:45 +00:00
Antoine du Hamel
ae73d48f7f
doc: update corepack.md to account for 0.20.0 changes
...
PR-URL: https://github.com/nodejs/node/pull/49486
Refs: https://github.com/nodejs/corepack/pull/291
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-09-16 11:52:30 +02:00
Uzlopak
db8217b1bf
errors: improve classRegExp in errors.js
...
PR-URL: https://github.com/nodejs/node/pull/49643
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2023-09-16 01:36:48 +00:00
Geoffrey Booth
f42a103991
esm: require braces for modules code
...
PR-URL: https://github.com/nodejs/node/pull/49657
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
2023-09-15 19:18:13 +00:00
Daniel Compton
6a489df73b
esm: clarify ERR_REQUIRE_ESM errors
...
In #39175 , better ESM errors were introduced. This commit tweaks the
language in the error slightly to make it clear that there are three
different options to resolve the error.
Refs: https://github.com/nodejs/node/pull/39175
PR-URL: https://github.com/nodejs/node/pull/49521
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
2023-09-15 05:13:54 +00:00
Joyee Cheung
dac5f29691
test: skip test-child-process-stdio-reuse-readable-stdio on Windows
...
It is flaky due to the same cause of test-child-process-pipe-dataflow
being flaky - cygwin quirks - so skip it on Windows too.
Drive-by: remove the skip mark of test-child-process-pipe-dataflow
in the status file and directly skip it in the test with a comment.
PR-URL: https://github.com/nodejs/node/pull/49621
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2023-09-14 21:23:46 +00:00
Yagiz Nizipli
ba28cd8c5b
doc: remove @anonrig from performance initiative
...
PR-URL: https://github.com/nodejs/node/pull/49641
Reviewed-By: Tierney Cyren <hello@bnb.im >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Claudio Wunder <cwunder@gnome.org >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2023-09-14 12:20:02 -07:00
Richard Lau
44084b81bb
doc: mark Node.js 16 as End-of-Life
...
PR-URL: https://github.com/nodejs/node/pull/49651
Refs: https://nodejs.org/en/blog/announcements/nodejs16-eol
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2023-09-14 16:22:41 +00:00
Joyee Cheung
2dfaee4bc8
module: fix the leak in SourceTextModule and ContextifySript
...
Replace the persistent handles to v8::Module and
v8::UnboundScript with an internal reference that V8's GC is
aware of to fix the leaks.
PR-URL: https://github.com/nodejs/node/pull/48510
Refs: https://github.com/nodejs/node/issues/44211
Refs: https://github.com/nodejs/node/issues/42080
Refs: https://github.com/nodejs/node/issues/47096
Refs: https://github.com/nodejs/node/issues/43205
Refs: https://github.com/nodejs/node/issues/38695
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
2023-09-14 15:42:26 +00:00
Joyee Cheung
4aa6b8c2e4
module: fix leak of vm.SyntheticModule
...
Previously we maintain a strong persistent reference to the
ModuleWrap to retrieve the ID-to-ModuleWrap mapping from
the HostImportModuleDynamicallyCallback using the number ID
stored in the host-defined options. As a result the ModuleWrap
would be kept alive until the Environment is shut down, which
would be a leak for user code. With the new symbol-based
host-defined option we can just get the ModuleWrap from the
JS-land WeakMap so there's now no need to maintain this
strong reference. This would at least fix the leak for
vm.SyntheticModule. vm.SourceTextModule is still leaking
due to the strong persistent reference to the v8::Module.
PR-URL: https://github.com/nodejs/node/pull/48510
Refs: https://github.com/nodejs/node/issues/44211
Refs: https://github.com/nodejs/node/issues/42080
Refs: https://github.com/nodejs/node/issues/47096
Refs: https://github.com/nodejs/node/issues/43205
Refs: https://github.com/nodejs/node/issues/38695
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
2023-09-14 15:42:25 +00:00
Joyee Cheung
bc9a875c99
module: use symbol in WeakMap to manage host defined options
...
Previously when managing the importModuleDynamically callback of
vm.compileFunction(), we use an ID number as the host defined option
and maintain a per-Environment ID -> CompiledFnEntry map to retain
the top-level referrer function returned by vm.compileFunction() in
order to pass it back to the callback, but it would leak because with
how we used v8::Persistent to maintain this reference, V8 would not
be able to understand the cycle and would just think that the
CompiledFnEntry was supposed to live forever. We made an attempt
to make that reference known to V8 by making the CompiledFnEntry weak
and using a private symbol to make CompiledFnEntry strongly
references the top-level referrer function in
https://github.com/nodejs/node/pull/46785 , but that turned out to be
unsound, because the there's no guarantee that the top-level function
must be alive while import() can still be initiated from that
function, since V8 could discard the top-level function and only keep
inner functions alive, so relying on the top-level function to keep
the CompiledFnEntry alive could result in use-after-free which caused
a revert of that fix.
With this patch we use a symbol in the host defined options instead of
a number, because with the stage-3 symbol-as-weakmap-keys proposal
we could directly use that symbol to keep the referrer alive using a
WeakMap. As a bonus this also keeps the other kinds of referrers
alive as long as import() can still be initiated from that
Script/Module, so this also fixes the long-standing crash caused by
vm.Script being GC'ed too early when its importModuleDynamically
callback still needs it.
PR-URL: https://github.com/nodejs/node/pull/48510
Refs: https://github.com/nodejs/node/issues/44211
Refs: https://github.com/nodejs/node/issues/42080
Refs: https://github.com/nodejs/node/issues/47096
Refs: https://github.com/nodejs/node/issues/43205
Refs: https://github.com/nodejs/node/issues/38695
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
2023-09-14 15:42:24 +00:00
Joyee Cheung
b289c6df11
test: mark test-runner-watch-mode as flaky
...
PR-URL: https://github.com/nodejs/node/pull/49627
Refs: https://github.com/nodejs/node/issues/49605
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
2023-09-14 14:55:19 +00:00