Skip to content

Commit 70b0ba2

Browse files
authored
Merge branch 'nodejs:main' into fix-56694
2 parents 1eeb385 + e55b02b commit 70b0ba2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+704
-163
lines changed

.github/workflows/create-release-proposal.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,11 @@ jobs:
7171
git config --local user.name "Node.js GitHub Bot"
7272
7373
- name: Start git node release prepare
74+
# `git update-index` tells git to ignore future changes to the `.sh` file,
75+
# `|| true` is there to ignore the error if such file doesn't exist yet.
7476
# The curl command is to make sure we run the version of the script corresponding to the current workflow.
7577
run: |
76-
git update-index --assume-unchanged tools/actions/create-release-proposal.sh
78+
git update-index --assume-unchanged tools/actions/create-release-proposal.sh || true
7779
curl -fsSLo tools/actions/create-release-proposal.sh https://github.com/${GITHUB_REPOSITORY}/raw/${GITHUB_SHA}/tools/actions/create-release-proposal.sh
7880
./tools/actions/create-release-proposal.sh "${RELEASE_DATE}" "${RELEASE_LINE}" "${GITHUB_ACTOR}"
7981
env:

.github/workflows/tools.yml

+8-6
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@ jobs:
284284
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
285285
rm temp-output
286286
steps:
287+
- name: Setup Git config
288+
run: |
289+
git config --global user.name "Node.js GitHub Bot"
290+
git config --global user.email "[email protected]"
287291
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
288292
if: github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id
289293
with:
@@ -301,17 +305,15 @@ jobs:
301305
if: env.COMMIT_MSG == '' && (github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id)
302306
run: |
303307
echo "COMMIT_MSG=${{ matrix.subsystem }}: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}" >> "$GITHUB_ENV"
304-
- uses: gr2m/create-or-update-pull-request-action@86ec1766034c8173518f61d2075cc2a173fb8c97 # v1.9.4
308+
- uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
305309
if: github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id
306310
# Creates a PR or update the Action's existing PR, or
307311
# no-op if the base branch is already up-to-date.
308-
env:
309-
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
310312
with:
311-
author: Node.js GitHub Bot <[email protected]>
312-
body: This is an automated update of ${{ matrix.id }} to ${{ env.NEW_VERSION }}.
313+
token: ${{ secrets.GH_USER_TOKEN }}
313314
branch: actions/tools-update-${{ matrix.id }} # Custom branch *just* for this Action.
315+
delete-branch: true
314316
commit-message: ${{ env.COMMIT_MSG }}
315317
labels: ${{ matrix.label }}
316318
title: '${{ matrix.subsystem }}: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}'
317-
update-pull-request-title-and-body: true
319+
body: This is an automated update of ${{ matrix.id }} to ${{ env.NEW_VERSION }}.

android-configure

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ command -v python3.12 >/dev/null && exec python3.12 "$0" "$@"
99
command -v python3.11 >/dev/null && exec python3.11 "$0" "$@"
1010
command -v python3.10 >/dev/null && exec python3.10 "$0" "$@"
1111
command -v python3.9 >/dev/null && exec python3.9 "$0" "$@"
12-
command -v python3.8 >/dev/null && exec python3.8 "$0" "$@"
1312
command -v python3 >/dev/null && exec python3 "$0" "$@"
1413
exec python "$0" "$@"
1514
''' "$0" "$@"
@@ -23,7 +22,7 @@ except ImportError:
2322
from distutils.spawn import find_executable as which
2423

2524
print('Node.js android configure: Found Python {}.{}.{}...'.format(*sys.version_info))
26-
acceptable_pythons = ((3, 13), (3, 12), (3, 11), (3, 10), (3, 9), (3, 8))
25+
acceptable_pythons = ((3, 13), (3, 12), (3, 11), (3, 10), (3, 9))
2726
if sys.version_info[:2] in acceptable_pythons:
2827
import android_configure
2928
else:

benchmark/es/error-stack.js

+22-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@
22

33
const common = require('../common.js');
44
const modPath = require.resolve('../fixtures/simple-error-stack.js');
5+
const nodeModulePath = require.resolve('../fixtures/node_modules/error-stack/simple-error-stack.js');
6+
const Module = require('node:module');
57

68
const bench = common.createBenchmark(main, {
7-
method: ['without-sourcemap', 'sourcemap'],
9+
method: [
10+
'without-sourcemap',
11+
'sourcemap',
12+
'node-modules-without-sourcemap',
13+
'node-module-sourcemap'],
814
n: [1e5],
915
});
1016

11-
function runN(n) {
17+
function runN(n, modPath) {
1218
delete require.cache[modPath];
1319
const mod = require(modPath);
1420
bench.start();
@@ -22,11 +28,23 @@ function main({ n, method }) {
2228
switch (method) {
2329
case 'without-sourcemap':
2430
process.setSourceMapsEnabled(false);
25-
runN(n);
31+
runN(n, modPath);
2632
break;
2733
case 'sourcemap':
2834
process.setSourceMapsEnabled(true);
29-
runN(n);
35+
runN(n, modPath);
36+
break;
37+
case 'node-modules-without-sourcemap':
38+
Module.setSourceMapsSupport(true, {
39+
nodeModules: false,
40+
});
41+
runN(n, nodeModulePath);
42+
break;
43+
case 'node-modules-sourcemap':
44+
Module.setSourceMapsSupport(true, {
45+
nodeModules: true,
46+
});
47+
runN(n, nodeModulePath);
3048
break;
3149
default:
3250
throw new Error(`Unexpected method "${method}"`);

benchmark/fixtures/node_modules/error-stack/simple-error-stack.js

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

benchmark/fixtures/node_modules/error-stack/simple-error-stack.ts

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ command -v python3.12 >/dev/null && exec python3.12 "$0" "$@"
99
command -v python3.11 >/dev/null && exec python3.11 "$0" "$@"
1010
command -v python3.10 >/dev/null && exec python3.10 "$0" "$@"
1111
command -v python3.9 >/dev/null && exec python3.9 "$0" "$@"
12-
command -v python3.8 >/dev/null && exec python3.8 "$0" "$@"
1312
command -v python3 >/dev/null && exec python3 "$0" "$@"
1413
exec python "$0" "$@"
1514
''' "$0" "$@"
@@ -23,7 +22,7 @@ except ImportError:
2322
from distutils.spawn import find_executable as which
2423

2524
print('Node.js configure: Found Python {}.{}.{}...'.format(*sys.version_info))
26-
acceptable_pythons = ((3, 13), (3, 12), (3, 11), (3, 10), (3, 9), (3, 8))
25+
acceptable_pythons = ((3, 13), (3, 12), (3, 11), (3, 10), (3, 9))
2726
if sys.version_info[:2] in acceptable_pythons:
2827
import configure
2928
else:

configure.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2143,7 +2143,7 @@ def make_bin_override():
21432143
if sys.platform == 'win32':
21442144
raise Exception('make_bin_override should not be called on win32.')
21452145
# If the system python is not the python we are running (which should be
2146-
# python 3.8+), then create a directory with a symlink called `python` to our
2146+
# python 3.9+), then create a directory with a symlink called `python` to our
21472147
# sys.executable. This directory will be prefixed to the PATH, so that
21482148
# other tools that shell out to `python` will use the appropriate python
21492149

doc/api/assert.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -909,11 +909,12 @@ weakSet2.add(obj);
909909

910910
// Comparing different instances fails, even with same contents
911911
assert.deepStrictEqual(weakSet1, weakSet2);
912-
// AssertionError: Expected inputs to be strictly deep-equal:
912+
// AssertionError: Values have same structure but are not reference-equal:
913913
// + actual - expected
914914
//
915-
// + WeakSet { <items unknown> }
916-
// - WeakSet { <items unknown> }
915+
// WeakSet {
916+
// <items unknown>
917+
// }
917918

918919
// Comparing the same instance to itself succeeds
919920
assert.deepStrictEqual(weakSet1, weakSet1);
@@ -1018,11 +1019,12 @@ weakSet2.add(obj);
10181019

10191020
// Comparing different instances fails, even with same contents
10201021
assert.deepStrictEqual(weakSet1, weakSet2);
1021-
// AssertionError: Expected inputs to be strictly deep-equal:
1022+
// AssertionError: Values have same structure but are not reference-equal:
10221023
// + actual - expected
10231024
//
1024-
// + WeakSet { <items unknown> }
1025-
// - WeakSet { <items unknown> }
1025+
// WeakSet {
1026+
// <items unknown>
1027+
// }
10261028

10271029
// Comparing the same instance to itself succeeds
10281030
assert.deepStrictEqual(weakSet1, weakSet1);

doc/api/cli.md

+17
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,13 @@ Previously gated the entire `import.meta.resolve` feature.
943943
<!-- YAML
944944
added: v8.8.0
945945
changes:
946+
- version:
947+
- v23.6.1
948+
- v22.13.1
949+
- v20.18.2
950+
pr-url: https://github.com/nodejs-private/node-private/pull/629
951+
description: Using this feature with the permission model enabled requires
952+
passing `--allow-worker`.
946953
- version: v12.11.1
947954
pr-url: https://github.com/nodejs/node/pull/29752
948955
description: This flag was renamed from `--loader` to
@@ -956,6 +963,8 @@ changes:
956963
Specify the `module` containing exported [module customization hooks][].
957964
`module` may be any string accepted as an [`import` specifier][].
958965

966+
This feature requires `--allow-worker` if used with the [Permission Model][].
967+
959968
### `--experimental-network-inspection`
960969

961970
<!-- YAML
@@ -1055,6 +1064,14 @@ report is not generated. See the documentation on
10551064
added:
10561065
- v22.3.0
10571066
- v20.18.0
1067+
changes:
1068+
- version:
1069+
- v23.6.1
1070+
- v22.13.1
1071+
- v20.18.2
1072+
pr-url: https://github.com/nodejs-private/node-private/pull/629
1073+
description: Using this feature with the permission model enabled requires
1074+
passing `--allow-worker`.
10581075
-->
10591076

10601077
> Stability: 1.0 - Early development

doc/api/module.md

+50
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,13 @@ added:
177177
- v20.6.0
178178
- v18.19.0
179179
changes:
180+
- version:
181+
- v23.6.1
182+
- v22.13.1
183+
- v20.18.2
184+
pr-url: https://github.com/nodejs-private/node-private/pull/629
185+
description: Using this feature with the permission model enabled requires
186+
passing `--allow-worker`.
180187
- version:
181188
- v20.8.0
182189
- v18.19.0
@@ -205,6 +212,8 @@ changes:
205212
Register a module that exports [hooks][] that customize Node.js module
206213
resolution and loading behavior. See [Customization hooks][].
207214
215+
This feature requires `--allow-worker` if used with the [Permission Model][].
216+
208217
### `module.registerHooks(options)`
209218
210219
<!-- YAML
@@ -1587,6 +1596,20 @@ import { findSourceMap, SourceMap } from 'node:module';
15871596
const { findSourceMap, SourceMap } = require('node:module');
15881597
```
15891598
1599+
### `module.getSourceMapsSupport()`
1600+
1601+
<!-- YAML
1602+
added: REPLACEME
1603+
-->
1604+
1605+
* Returns: {Object}
1606+
* `enabled` {boolean} If the source maps support is enabled
1607+
* `nodeModules` {boolean} If the support is enabled for files in `node_modules`.
1608+
* `generatedCode` {boolean} If the support is enabled for generated code from `eval` or `new Function`.
1609+
1610+
This method returns whether the [Source Map v3][Source Map] support for stack
1611+
traces is enabled.
1612+
15901613
<!-- Anchors to make sure old links find a target -->
15911614
15921615
<a id="module_module_findsourcemap_path_error"></a>
@@ -1606,6 +1629,31 @@ added:
16061629
`path` is the resolved path for the file for which a corresponding source map
16071630
should be fetched.
16081631
1632+
### `module.setSourceMapsSupport(enabled[, options])`
1633+
1634+
<!-- YAML
1635+
added: REPLACEME
1636+
-->
1637+
1638+
* `enabled` {boolean} Enable the source map support.
1639+
* `options` {Object} Optional
1640+
* `nodeModules` {boolean} If enabling the support for files in
1641+
`node_modules`. **Default:** `false`.
1642+
* `generatedCode` {boolean} If enabling the support for generated code from
1643+
`eval` or `new Function`. **Default:** `false`.
1644+
1645+
This function enables or disables the [Source Map v3][Source Map] support for
1646+
stack traces.
1647+
1648+
It provides same features as launching Node.js process with commandline options
1649+
`--enable-source-maps`, with additional options to alter the support for files
1650+
in `node_modules` or generated codes.
1651+
1652+
Only source maps in JavaScript files that are loaded after source maps has been
1653+
enabled will be parsed and loaded. Preferably, use the commandline options
1654+
`--enable-source-maps` to avoid losing track of source maps of modules loaded
1655+
before this API call.
1656+
16091657
### Class: `module.SourceMap`
16101658
16111659
<!-- YAML
@@ -1705,6 +1753,8 @@ returned object contains the following keys:
17051753
[Conditional exports]: packages.md#conditional-exports
17061754
[Customization hooks]: #customization-hooks
17071755
[ES Modules]: esm.md
1756+
[Permission Model]: permissions.md#permission-model
1757+
[Source Map]: https://sourcemaps.info/spec.html
17081758
[Source map v3 format]: https://sourcemaps.info/spec.html#h.mofvlxcwqzej
17091759
[V8 JavaScript code coverage]: https://v8project.blogspot.com/2017/12/javascript-code-coverage.html
17101760
[V8 code cache]: https://v8.dev/blog/code-caching-for-devs

doc/api/permissions.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Permissions
22

3+
<!--introduced_in=v20.0.0-->
4+
5+
<!-- source_link=src/permission.cc -->
6+
37
Permissions can be used to control what system resources the
48
Node.js process has access to or what actions the process can take
59
with those resources.
@@ -26,12 +30,18 @@ If you find a potential security vulnerability, please refer to our
2630

2731
### Permission Model
2832

29-
<!-- type=misc -->
33+
<!-- YAML
34+
added: v20.0.0
35+
changes:
36+
- version:
37+
- v23.5.0
38+
- v22.13.0
39+
pr-url: https://github.com/nodejs/node/pull/56201
40+
description: This feature is no longer experimental.
41+
-->
3042

3143
> Stability: 2 - Stable.
3244
33-
<!-- name=permission-model -->
34-
3545
The Node.js Permission Model is a mechanism for restricting access to specific
3646
resources during execution.
3747
The API exists behind a flag [`--permission`][] which when enabled,

doc/api/process.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -4003,7 +4003,7 @@ added:
40034003
- v14.18.0
40044004
-->
40054005
4006-
> Stability: 1 - Experimental
4006+
> Stability: 1 - Experimental: Use [`module.setSourceMapsSupport()`][] instead.
40074007
40084008
* `val` {boolean}
40094009
@@ -4016,6 +4016,9 @@ It provides same features as launching Node.js process with commandline options
40164016
Only source maps in JavaScript files that are loaded after source maps has been
40174017
enabled will be parsed and loaded.
40184018
4019+
This implies calling `module.setSourceMapsSupport()` with an option
4020+
`{ nodeModules: true, generatedCode: true }`.
4021+
40194022
## `process.setUncaughtExceptionCaptureCallback(fn)`
40204023
40214024
<!-- YAML
@@ -4050,7 +4053,7 @@ added:
40504053
- v18.19.0
40514054
-->
40524055
4053-
> Stability: 1 - Experimental
4056+
> Stability: 1 - Experimental: Use [`module.getSourceMapsSupport()`][] instead.
40544057
40554058
* {boolean}
40564059
@@ -4517,7 +4520,9 @@ cases:
45174520
[`console.error()`]: console.md#consoleerrordata-args
45184521
[`console.log()`]: console.md#consolelogdata-args
45194522
[`domain`]: domain.md
4523+
[`module.getSourceMapsSupport()`]: module.md#modulegetsourcemapssupport
45204524
[`module.isBuiltin(id)`]: module.md#moduleisbuiltinmodulename
4525+
[`module.setSourceMapsSupport()`]: module.md#modulesetsourcemapssupportenabled-options
45214526
[`net.Server`]: net.md#class-netserver
45224527
[`net.Socket`]: net.md#class-netsocket
45234528
[`os.constants.dlopen`]: os.md#dlopen-constants

0 commit comments

Comments
 (0)