Commit Graph

39153 Commits (0ae8bf8dbc3d5db9a604c7be66aa22893e109fa0)

Author SHA1 Message Date
Tobias Nießen 0ae8bf8dbc msi: do not create AppData\Roaming\npm
This effectively reverts e431cae7e7 due to
security concerns. The directory is being created with elevated
privileges but its path may depend on an unprivileged user's environment
variables. Creating a directory in certain sensitive locations can cause
Windows to become inoperable.

Creating AppData\Roaming\npm was an intentional addition in order to
resolve https://github.com/nodejs/node-v0.x-archive/issues/8141, which
appears to have been a common issue for users of npm. However, this was
implemented before 4cfe5eb9af, which
changed the MSI installation scope to perMachine. There were concerns
about creating the npm directory in that PR, albeit not related to
security (see https://github.com/nodejs/node-v0.x-archive/pull/25640).

Refs: https://github.com/nodejs/node-v0.x-archive/issues/8141
Refs: https://github.com/nodejs/node-v0.x-archive/pull/8838
Refs: https://github.com/nodejs/node-v0.x-archive/pull/25640
PR-URL: https://github.com/nodejs-private/node-private/pull/408
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
CVE-ID: CVE-2023-30585
2023-06-20 17:30:15 -03:00
RafaelGSS 56b1a0fca4 permission: handle fs.watchFile
PR-URL: https://github.com/nodejs-private/node-private/pull/404
Refs: https://hackerone.com/bugs?subject=nodejs&report_id=1966499
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
CVE-ID: CVE-2023-30582
2023-06-20 17:30:08 -03:00
RafaelGSS b607b74a4f 2023-06-20, Version 18.16.1 'Hydrogen' (LTS)
This is a security release.

Notable changes:

Following CVEs are fixed in this release:

* CVE-2023-30581: `mainModule.__proto__` Bypass Experimental Policy Mechanism (High)
* CVE-2023-30585: Privilege escalation via Malicious Registry Key manipulation during Node.js installer repair process (Medium)
* CVE-2023-30588: Process interuption due to invalid Public Key information in x509 certificates (Medium)
* CVE-2023-30589: HTTP Request Smuggling via Empty headers separated by CR (Medium)
* CVE-2023-30590: DiffieHellman does not generate keys after setting a private key (Medium)
* OpenSSL Security Releases
  * https://www.openssl.org/news/secadv/20230328.txt
  * https://www.openssl.org/news/secadv/20230420.txt
  * https://www.openssl.org/news/secadv/20230530.txt
* c-ares vulnerabilities:
  * GHSA-9g78-jv2r-p7vc
  * GHSA-8r8p-23f3-64c2
  * GHSA-54xr-f67r-4pc4
  * GHSA-x6mf-cxr9-8q6v

PR-URL: https://github.com/nodejs-private/node-private/pull/434
2023-06-20 17:26:23 -03:00
RafaelGSS 167dc77d85 2023-06-20, Version 20.3.1 (Current)
This is a security release.

Notable Changes

The following CVEs are fixed in this release:
* CVE-2023-30581: `mainModule.__proto__` Bypass Experimental Policy Mechanism (High)
* CVE-2023-30584: Path Traversal Bypass in Experimental Permission Model (High)
* CVE-2023-30587: Bypass of Experimental Permission Model via Node.js Inspector (High)
* CVE-2023-30582: Inadequate Permission Model Allows Unauthorized File Watching (Medium)
* CVE-2023-30583: Bypass of Experimental Permission Model via fs.openAsBlob() (Medium)
* CVE-2023-30585: Privilege escalation via Malicious Registry Key manipulation during Node.js installer repair process (Medium)
* CVE-2023-30586: Bypass of Experimental Permission Model via Arbitrary OpenSSL Engines (Medium)
* CVE-2023-30588: Process interuption due to invalid Public Key information in x509 certificates (Medium)
* CVE-2023-30589: HTTP Request Smuggling via Empty headers separated by CR (Medium)
* CVE-2023-30590: DiffieHellman does not generate keys after setting a private key (Medium)

* OpenSSL Security Releases
  * [OpenSSL security advisory 28th March](https://www.openssl.org/news/secadv/20230328.txt).
  * [OpenSSL security advisory 20th April](https://www.openssl.org/news/secadv/20230420.txt).
  * [OpenSSL security advisory 30th May](https://www.openssl.org/news/secadv/20230530.txt)

PR-URL: https://github.com/nodejs-private/node-private/pull/435
2023-06-20 17:08:45 -03:00
RafaelGSS c09acb3ea8 2023-06-20, Version 16.20.1 'Gallium' (LTS)
This is a security release.

Notable changes:

Following CVEs are fixed in this release:

* CVE-2023-30581: `mainModule.__proto__` Bypass Experimental Policy Mechanism (High)
* CVE-2023-30585: Privilege escalation via Malicious Registry Key manipulation during Node.js installer repair process (Medium)
* CVE-2023-30588: Process interuption due to invalid Public Key information in x509 certificates (Medium)
* CVE-2023-30589: HTTP Request Smuggling via Empty headers separated by CR (Medium)
* CVE-2023-30590: DiffieHellman does not generate keys after setting a private key (Medium)
* OpenSSL Security Releases
  * https://www.openssl.org/news/secadv/20230328.txt
  * https://www.openssl.org/news/secadv/20230420.txt
  * https://www.openssl.org/news/secadv/20230530.txt
* c-ares vulnerabilities:
  * GHSA-9g78-jv2r-p7vc
  * GHSA-8r8p-23f3-64c2
  * GHSA-54xr-f67r-4pc4
  * GHSA-x6mf-cxr9-8q6v

PR-URL: https://github.com/nodejs-private/node-private/pull/432
2023-06-20 16:21:56 -03:00
Luigi Pinca e7646a5dc0
tools: replace sed with perl
For cross-platform compatibility use perl instead of sed.

Fixes: https://github.com/nodejs/node/issues/48496
PR-URL: https://github.com/nodejs/node/pull/48499
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-06-20 09:11:55 +00:00
Jacob Hummer 43c3d9f9b4
doc: link to Runtime Keys in export conditions
This commit:
1. Adds a link to the WinterCG Runtime Keys proposal draft spec in the
    documentation for the `export` condition.
2. Adds a criteria to add more export conditions to the Node.js docs:
    they should be Node.js core-relevant.
3. Removes the "deno" and "react-native" export conditions from the core
    docs with the expectation that readers will follow the link to the
    Runtime Keys proposal draft spec to learn about them and more.

PR-URL: https://github.com/nodejs/node/pull/48408
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-06-20 02:24:27 +00:00
Marco Ippolito 51ca71cb51
tools: automate update openssl v16
PR-URL: https://github.com/nodejs/node/pull/48377
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2023-06-19 12:53:09 +00:00
Franciszek Koltuniuk 8e710c95f0
http: fix for handling on boot timers headers and request
This change is a fix for handling headersTimeout and requestTimeout
that causes unexpected behavior if the HTTP server is started on boot:

 - the connections to the server can be closed immediately
   with the status HTTP 408

This issue usually happens on IoT or embedded devices where
the reference timestamp (returned by uv_hrtime()) is counted since boot
and can be smaller than the headersTimeout or the requestTimeout value.

Additionally added performance improvement to process the list of
connection only if one of the timers should be processed

PR-URL: https://github.com/nodejs/node/pull/48291
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2023-06-19 09:33:02 +00:00
Node.js GitHub Bot 9bdd17230d
tools: update eslint to 8.43.0
PR-URL: https://github.com/nodejs/node/pull/48487
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-06-18 06:25:18 +00:00
Node.js GitHub Bot 6287d4d3f8 tools: update doc to to-vfile@8.0.0
PR-URL: https://github.com/nodejs/node/pull/48485
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2023-06-18 06:12:23 +00:00
Rich Trott 04bd9fd5b3 tools: prepare tools/doc for to-vfile 8.0.0
toVFile.readSync() is removed in favor of readSync().

PR-URL: https://github.com/nodejs/node/pull/48485
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2023-06-18 06:12:22 +00:00
Rafael Gonzaga ff14b24e12
lib: fix output message when repl is used with pm
PR-URL: https://github.com/nodejs/node/pull/48438
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2023-06-17 17:28:38 +00:00
sinkhaha 0d725d6fa0
doc: update fs flags documentation
PR-URL: https://github.com/nodejs/node/pull/48463
Fixes: https://github.com/nodejs/node/issues/48452
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2023-06-16 19:40:01 +00:00
Gabriel Schulhof 3c35cd4a74 node-api: provide napi_define_properties fast path
Implement defining properties via V8's
`v8::Object::CreateDataProperty()`, which is faster for data-valued,
writable, configurable, and enumerable properties.

Re: https://github.com/nodejs/node/issues/45905
Signed-off-by: Gabriel Schulhof <gabrielschulhof@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/48440
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2023-06-15 18:07:30 -07:00
Antoine du Hamel 64255b11bd
doc: revise `error.md` introduction
PR-URL: https://github.com/nodejs/node/pull/48423
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
2023-06-15 23:24:53 +00:00
Yagiz Nizipli d2dfdd654e src: add V8 fast api to `guessHandleType`
PR-URL: https://github.com/nodejs/node/pull/48349
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2023-06-15 19:21:50 +00:00
Yagiz Nizipli 5613e223d5 src: return uint32 for `guessHandleType`
PR-URL: https://github.com/nodejs/node/pull/48349
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2023-06-15 19:21:49 +00:00
Chemi Atlow f3ee4e2c96
lib: create weakRef only if any signals provided
PR-URL: https://github.com/nodejs/node/pull/48448
Fixes: https://github.com/nodejs/node/issues/48419
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-06-15 12:55:12 +00:00
Preveen P c760ff2aac
doc: add preveen-stack to triagers
PR-URL: https://github.com/nodejs/node/pull/48387
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Qingyu Deng <i@ayase-lab.com>
2023-06-15 11:25:27 +00:00
Chengzhong Wu ee1b6ab498 lib: remove obsolete deletion of bufferBinding.zeroFill
PR-URL: https://github.com/nodejs/node/pull/47881
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
2023-06-15 06:24:51 +00:00
Chengzhong Wu 77df1d84c7 lib: move web global bootstrapping to the expected file
PR-URL: https://github.com/nodejs/node/pull/47881
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
2023-06-15 06:24:50 +00:00
Node.js GitHub Bot f3b713d187
tools: update lint-md-dependencies
- `@rollup/plugin-commonjs@25.0.1`
- `rollup@3.24.1`

PR-URL: https://github.com/nodejs/node/pull/48417
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-06-14 22:57:44 +00:00
Moshe Atlow 363eca1033
doc: refine when file is undefined in test events
PR-URL: https://github.com/nodejs/node/pull/48451
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2023-06-14 12:41:27 +00:00
Jiawen Geng b0e08d178e
build: sync libuv header change
PR-URL: https://github.com/nodejs/node/pull/48429
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2023-06-14 05:27:57 +00:00
Gabriel Schulhof 60d9aed307 node-api: implement external strings
Introduce APIs that allow for the creation of JavaScript strings without
copying the underlying native string into the engine. The APIs fall back
to regular string creation if the engine's external string APIs are
unavailable. In this case, an optional boolean out-parameter indicates
that the string was copied, and the optional finalizer is called if
given.

PR-URL: https://github.com/nodejs/node/pull/48339
Fixes: https://github.com/nodejs/node/issues/48198
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Signed-off-by: Gabriel Schulhof <gabrielschulhof@gmail.com>
2023-06-13 21:54:03 -07:00
legendecas ac0853c4ee src: make realm binding data store weak
The binding data must be weak so that it won't keep the realm reachable
from strong GC roots indefinitely. The wrapper object of binding data
should be referenced from JavaScript, thus the binding data should be
reachable throughout the lifetime of the realm.

PR-URL: https://github.com/nodejs/node/pull/47688
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2023-06-14 02:05:00 +00:00
legendecas 7d49619730 src: remove aliased buffer weak callback
An AliasedBuffer can be nested in a BaseObject and their weak callbacks
invoke order are not guaranteed. Prevent aliased buffer from being
accessed in its weak callback as its validness can be checked with the
emptiness of the persistent handle.

PR-URL: https://github.com/nodejs/node/pull/47688
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2023-06-14 02:04:59 +00:00
Moshe Atlow 8bc6e193a0
test_runner: add enqueue and dequeue events
PR-URL: https://github.com/nodejs/node/pull/48428
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2023-06-13 18:33:43 +00:00
Keyhan Vakil 3ce303c3ee doc: add kvakil to collaborators
...and remove them triagers

Fixes: https://github.com/nodejs/node/issues/48155
PR-URL: https://github.com/nodejs/node/pull/48449
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-06-13 15:27:08 +00:00
Chemi Atlow d4e99b1a66
stream: remove asIndexedPairs
PR-URL: https://github.com/nodejs/node/pull/48150
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2023-06-13 12:54:45 +00:00
Node.js GitHub Bot d402e2ab78
crypto: update root certificates to NSS 3.90
This is the certdata.txt[0] from NSS 3.90, released on 2023-04-06.

This is the version of NSS that shipped in Firefox 113 on
2023-05-09.

Certificates added:
- BJCA Global Root CA1
- BJCA Global Root CA2

[0] https://hg.mozilla.org/projects/nss/raw-file/NSS_3_90_RTM/lib/ckfw/builtins/certdata.txt

PR-URL: https://github.com/nodejs/node/pull/48416
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2023-06-13 00:55:36 +00:00
Node.js GitHub Bot f6a3ec93aa
deps: update zlib to 1.2.13.1-motley-3ca9f16
PR-URL: https://github.com/nodejs/node/pull/48413
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2023-06-13 00:55:26 +00:00
Michael Dawson ac6f594c97 quic: address new coverity warning
- address coverity warning about unitialized variable

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/48384
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
2023-06-12 16:01:22 -04:00
Richard Lau 8d651ce81e
crypto: remove OPENSSL_FIPS guard for OpenSSL 3
The OPENSSL_FIPS guard is only needed for versions of OpenSSL earlier
than 3.0.

Removing the guard for OpenSSL 3 fixes `parallel/test-crypto-fips`
when run with a FIPS enabled OpenSSL 3 configuration.

PR-URL: https://github.com/nodejs/node/pull/48392
Refs: https://github.com/nodejs/node/issues/48379
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2023-06-12 19:43:22 +00:00
Michael Dawson 1da9099ac9 doc: add additional info on TSFN dispatch
Refs: https://github.com/nodejs/node/issues/48356

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/48367
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2023-06-12 14:30:37 -04:00
Michael Dawson 5f32914797 doc: add link for news from security wg
Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/48396
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2023-06-12 14:18:11 -04:00
Darshan Sen 4e0066eaf8
doc: fix typo in events.md
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/48436
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-06-12 16:15:04 +00:00
Congcong Cai ed92b1fdaf
src: handle wasm out of bound in osx will raise SIGBUS correctly
fix: #46559
OSX will raise both SIGBUS and SIGSEGV when out of bound memory visit,
This commit set sigaction in OSX for two signals to handle this.

PR-URL: https://github.com/nodejs/node/pull/46561
Fixes: https://github.com/nodejs/node/issues/46559
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2023-06-12 14:50:21 +00:00
linkgoron bd7a8087a5
https: fix connection checking interval not clearing on server close
The connection interval should close when httpsServer.close is called
similarly to how it gets cleared when httpServer.close is called.

fixes: https://github.com/nodejs/node/issues/48373
PR-URL: https://github.com/nodejs/node/pull/48383
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2023-06-12 07:47:25 +00:00
João Lenon a40a6c890a
module: implement `register` utility
PR-URL: https://github.com/nodejs/node/pull/46826
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-06-12 00:00:46 +00:00
Antoine du Hamel d2d4a310f1
typings: fix JSDoc in ESM loader modules
PR-URL: https://github.com/nodejs/node/pull/48424
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2023-06-11 21:09:21 +02:00
Moshe Atlow c21fe3ad87
test_runner: make `--test-name-pattern` recursive
PR-URL: https://github.com/nodejs/node/pull/48382
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2023-06-11 15:02:18 +00:00
Tobias Nießen 4ee8ef269b
quic: prevent copying ngtcp2_cid_token
PR-URL: https://github.com/nodejs/node/pull/48370
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-06-11 10:07:59 +00:00
Debadree Chatterjee 8cc14387a2
lib: fix blob.stream() causing hanging promises
Refs: https://github.com/nodejs/node/issues/47993#issuecomment-1546901936
PR-URL: https://github.com/nodejs/node/pull/48232
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2023-06-11 09:24:39 +00:00
Antoine du Hamel 2c6698b4db
lib: add support for inherited custom inspection methods
PR-URL: https://github.com/nodejs/node/pull/48306
Fixes: https://github.com/nodejs/node/issues/48207
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-06-11 08:10:47 +00:00
Hemanth HM 0c875bbfc8
repl: display dynamic import variant in static import error messages
Enhance the REPL message for static import error message.

```
> import {foo, bar} from 'moo';
import {foo, bar} from 'moo';
^^^^^^

Uncaught:
SyntaxError: .* dynamic import: const {foo,bar} = await import('moo');
```

PR-URL: https://github.com/nodejs/node/pull/48129
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-06-11 08:10:39 +00:00
Joyee Cheung 718f62bfcf
bootstrap: unify snapshot builder and embedder entry points
- Run the embedder entry point directly through
  runEmbedderEntryPoint(), instead of going through another
  JS -> C++ trip through the function returned by
  getEmbedderEntryFunction()
- For --build-snapshot, read the snapshot script code directly in C++
  and pass it to SnapshotBuilder::Generate(), this makes the entry point
  more explicit instead of hiding it in JS land, and also makes it
  possible to invoke SnapshotBuilder::Generate() internally to create
  a custom snapshot.
- Previously we used process.execPath for the embedder to create
  __filename and __dirname in the snapshot builder script while using
  process.argv[1] for --build-snapshot (where it's always set) which
  results in inconsistencies. We now require the embedder to also set
  args[1] when creating the Environment if they intend to run snapshot
  scripts with a context that contains __filename and __dirname, which
  would be derived from args[1]. If they prefer not to include
  build-time paths in the snapshot, we now provide
  node::GetAnonymousMainPath() as an alternative.

PR-URL: https://github.com/nodejs/node/pull/48242
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-06-11 00:34:19 +02:00
Sam James ad0bbaf34a
test: add missing <algorithm> include for std::find
GCC 14 drops some transitive includes within libstdc++.

Explicitly include <algorithm> for std::find.

Signed-off-by: Sam James <sam@gentoo.org>
PR-URL: https://github.com/nodejs/node/pull/48380
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
2023-06-09 17:29:00 +00:00
Joyee Cheung 4ff55ec2e1
bootstrap: simplify initialization of source map handlers
- Move the initialization of process.setSourceMapsEnabled
  and the maybeCacheGeneratedSourceMap callback to
  bootstrap/node.js so they are included in the snapshot.
- Simplify the handling of --enable-source-maps by explicitly
  calling setSourceMapsEnabled() during pre-execution.

PR-URL: https://github.com/nodejs/node/pull/48304
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2023-06-09 15:45:37 +02:00