Delete deprecated an never used enum options `kAllowedInEnvironment`
and `kDisallowedInEnvironment` in `OptionEnvvarSettings`
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/53079
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/55699
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This is the certdata.txt[0] from NSS 3.104.
This is the version of NSS that shipped in Firefox 131.0 on 2024-10-01.
Certificates added:
- FIRMAPROFESIONAL CA ROOT-A WEB
- TWCA CYBER Root CA
- SecureSign Root CA12
- SecureSign Root CA14
- SecureSign Root CA15
[0] https://raw.githubusercontent.com/nss-dev/nss/refs/tags/NSS_3_104_RTM/lib/ckfw/builtins/certdata.txt
PR-URL: https://github.com/nodejs/node/pull/55681
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Determine the NSS version from actual Firefox releases, instead of
attempting to parse a wiki page (which is sensitive to formatting
changes and relies on the page being up to date).
PR-URL: https://github.com/nodejs/node/pull/55681
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Previously in the CommonJS loader, --inspect-brk is implemented
checking whether the module points to the result of re-resolving
process.argv[1] to determine whether the module is the entry point.
This is unnecessarily complex, especially now that we store that
information in the module as kIsMainSymbol. This patch updates
it to simply check that symbol property instead.
PR-URL: https://github.com/nodejs/node/pull/55679
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
The ability to revert the fix for CVE-2023-46809 was only added to
Node.js 18.x, 20.x and 21.x as, per policy, security reverts are only
added to the existing supported release lines at the time of the fix.
The error message thrown when `RSA_PKCS1_PADDING` is used on `main`
and subsequent major versions (i.e. Node.js 22 and 23) when OpenSSL
does not support implicit rejections should not have suggested that
it is possible to revert the fix.
PR-URL: https://github.com/nodejs/node/pull/55629
Fixes: https://github.com/nodejs/node/issues/55628
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
The code sample at the top of the "Performance measurements API"
section of the docs does not run.
The code in question:
```js
const { PerformanceObserver, performance } = require('node:perf_hooks');
const obs = new PerformanceObserver((items) => {
console.log(items.getEntries()[0].duration);
performance.clearMarks();
});
obs.observe({ type: 'measure' });
performance.measure('Start to Now');
performance.mark('A');
doSomeLongRunningProcess(() => {
performance.measure('A to Now', 'A');
performance.mark('B');
performance.measure('A to B', 'A', 'B');
});
```
If you replace `doSomeLongRunningProcess` with an IIFE with a sleep()
at the top of it, you get this:
```js
const { PerformanceObserver, performance } = require('node:perf_hooks');
const obs = new PerformanceObserver((items) => {
console.log(items.getEntries()[0].duration);
performance.clearMarks();
});
obs.observe({ type: 'measure' });
performance.measure('Start to Now');
performance.mark('A');
(async function doSomeLongRunningProcess() {
await new Promise(r => setTimeout(r, 5000));
performance.measure('A to Now', 'A');
performance.mark('B');
performance.measure('A to B', 'A', 'B');
})()
```
When you run this, you get the following output:
```sh
$ node performance-test.js
17.873416
node:internal/per_context/domexception:53
ErrorCaptureStackTrace(this);
^
DOMException [SyntaxError]: The "A" performance mark has not been set
at new DOMException (node:internal/per_context/domexception:53:5)
at __node_internal_ (node:internal/util:695:10)
at getMark (node:internal/perf/usertiming:65:11)
at calculateStartDuration (node:internal/perf/usertiming:202:13)
at measure (node:internal/perf/usertiming:220:7)
at Performance.measure (node:internal/perf/performance:135:12)
at /private/tmp/performance-test.js:14:15
Node.js v20.11.1
```
I believe it's due to the call to `performance.clearMarks();` in the
PerformanceObserver callback. If you remove that, it works as expected:
```js
const { PerformanceObserver, performance } = require('node:perf_hooks');
const obs = new PerformanceObserver((items) => {
console.log(items.getEntries()[0].duration);
});
obs.observe({ type: 'measure' });
performance.measure('Start to Now');
performance.mark('A');
(async function doSomeLongRunningProcess() {
await new Promise(r => setTimeout(r, 5000));
performance.measure('A to Now', 'A');
performance.mark('B');
performance.measure('A to B', 'A', 'B');
})()
```
```sh
$ node performance-test.js
17.761083
5002.468417
```
PR-URL: https://github.com/nodejs/node/pull/54227
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This reverts commit 00b2f07f9d.
PR-URL: https://github.com/nodejs/node/pull/55527
Fixes: https://github.com/nodejs/node/issues/17801
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
`util.getCallSite` returns an array of call site objects. Rename the
function to reflect that it returns a given count of frames captured
as an array of call site object.
Renames the first parameter `frames` to be `frameCount` to indicate
that it specifies the count of returned call sites.
PR-URL: https://github.com/nodejs/node/pull/55626
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/55625
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Many user reported issues show poor awareness of the
nature of console streams. explicitly document that.
PR-URL: https://github.com/nodejs/node/pull/55616
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/55601
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Create and store an AsyncResource for each stream, following a similar
approach as used in HttpAgent.
Fixes: https://github.com/nodejs/node/issues/55376
PR-URL: https://github.com/nodejs/node/pull/55460
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
This refactors the CommonJS loading a bit to create a center point
that handles source loading (`loadSource`) and make format detection
more consistent to pave the way for future synchronous hooks.
- Handle .mjs in the .js handler, similar to how .cjs has been handled.
- Generate the legacy ERR_REQUIRE_ESM in a getRequireESMError() for
both .mts and require(esm) handling (when it's disabled).
PR-URL: https://github.com/nodejs/node/pull/55590
Refs: https://github.com/nodejs/loaders/pull/198
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>