Skip to content

Commit 134e75a

Browse files
authored
Merge branch 'main' into backport-script
2 parents 1e3f814 + b0edb28 commit 134e75a

File tree

225 files changed

+1115
-1017
lines changed

Some content is hidden

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

225 files changed

+1115
-1017
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ release.
3535
</tr>
3636
<tr>
3737
<td valign="top">
38-
<b><a href="doc/changelogs/CHANGELOG_V20.md#20.6.0">20.6.0</a></b><br/>
38+
<b><a href="doc/changelogs/CHANGELOG_V20.md#20.6.1">20.6.1</a></b><br/>
39+
<a href="doc/changelogs/CHANGELOG_V20.md#20.6.0">20.6.0</a><br/>
3940
<a href="doc/changelogs/CHANGELOG_V20.md#20.5.1">20.5.1</a><br/>
4041
<a href="doc/changelogs/CHANGELOG_V20.md#20.5.0">20.5.0</a><br/>
4142
<a href="doc/changelogs/CHANGELOG_V20.md#20.4.0">20.4.0</a><br/>

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,6 +1423,7 @@ FORMAT_CPP_FILES += $(LINT_CPP_FILES)
14231423
# C source codes.
14241424
FORMAT_CPP_FILES += $(wildcard \
14251425
benchmark/napi/*/*.c \
1426+
test/js-native-api/*.h \
14261427
test/js-native-api/*/*.c \
14271428
test/js-native-api/*/*.h \
14281429
test/node-api/*/*.c \

benchmark/webstreams/creation.js

Lines changed: 60 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,99 @@
22
const common = require('../common.js');
33
const {
44
ReadableStream,
5+
ReadableStreamDefaultReader,
6+
ReadableStreamBYOBReader,
57
TransformStream,
68
WritableStream,
79
} = require('node:stream/web');
810
const assert = require('assert');
911

1012
const bench = common.createBenchmark(main, {
1113
n: [50e3],
12-
kind: ['ReadableStream', 'TransformStream', 'WritableStream'],
14+
kind: [
15+
'ReadableStream',
16+
'TransformStream',
17+
'WritableStream',
18+
19+
'ReadableStreamDefaultReader',
20+
'ReadableStreamBYOBReader',
21+
22+
'ReadableStream.tee',
23+
],
1324
});
1425

15-
let rs, ws, ts;
26+
let readableStream;
27+
let transformStream;
28+
let writableStream;
29+
let readableStreamDefaultReader;
30+
let readableStreamBYOBReader;
31+
let teeResult;
1632

1733
function main({ n, kind }) {
1834
switch (kind) {
1935
case 'ReadableStream':
2036
bench.start();
2137
for (let i = 0; i < n; ++i)
22-
rs = new ReadableStream();
38+
readableStream = new ReadableStream();
2339
bench.end(n);
2440

2541
// Avoid V8 deadcode (elimination)
26-
assert.ok(rs);
42+
assert.ok(readableStream);
2743
break;
2844
case 'WritableStream':
2945
bench.start();
3046
for (let i = 0; i < n; ++i)
31-
ws = new WritableStream();
47+
writableStream = new WritableStream();
3248
bench.end(n);
3349

3450
// Avoid V8 deadcode (elimination)
35-
assert.ok(ws);
51+
assert.ok(writableStream);
3652
break;
3753
case 'TransformStream':
3854
bench.start();
3955
for (let i = 0; i < n; ++i)
40-
ts = new TransformStream();
56+
transformStream = new TransformStream();
57+
bench.end(n);
58+
59+
// Avoid V8 deadcode (elimination)
60+
assert.ok(transformStream);
61+
break;
62+
case 'ReadableStreamDefaultReader': {
63+
const readers = Array.from({ length: n }, () => new ReadableStream());
64+
65+
bench.start();
66+
for (let i = 0; i < n; ++i)
67+
readableStreamDefaultReader = new ReadableStreamDefaultReader(readers[i]);
68+
bench.end(n);
69+
70+
// Avoid V8 deadcode (elimination)
71+
assert.ok(readableStreamDefaultReader);
72+
break;
73+
}
74+
case 'ReadableStreamBYOBReader': {
75+
const readers = Array.from({ length: n }, () => new ReadableStream({ type: 'bytes' }));
76+
77+
bench.start();
78+
for (let i = 0; i < n; ++i)
79+
readableStreamBYOBReader = new ReadableStreamBYOBReader(readers[i]);
80+
bench.end(n);
81+
82+
// Avoid V8 deadcode (elimination)
83+
assert.ok(readableStreamBYOBReader);
84+
break;
85+
}
86+
case 'ReadableStream.tee': {
87+
const streams = Array.from({ length: n }, () => new ReadableStream());
88+
89+
bench.start();
90+
for (let i = 0; i < n; ++i)
91+
teeResult = streams[i].tee();
4192
bench.end(n);
4293

4394
// Avoid V8 deadcode (elimination)
44-
assert.ok(ts);
95+
assert.ok(teeResult);
4596
break;
97+
}
4698
default:
4799
throw new Error('Invalid kind');
48100
}

benchmark/webstreams/pipe-to.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async function main({ n, highWaterMarkR, highWaterMarkW }) {
1818
const rs = new ReadableStream({
1919
highWaterMark: highWaterMarkR,
2020
pull: function(controller) {
21-
if (i++ === n) {
21+
if (i++ < n) {
2222
controller.enqueue(b);
2323
} else {
2424
controller.close();

deps/npm/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99

1010
One of the following versions of [Node.js](https://nodejs.org/en/download/) must be installed to run **`npm`**:
1111

12-
* `14.x.x` >= `14.17.0`
13-
* `16.x.x` >= `16.13.0`
14-
* `18.0.0` or higher
12+
* `18.x.x` >= `18.17.0`
13+
* `20.5.0` or higher
1514

1615
### Installation
1716

deps/npm/docs/content/commands/npm-install-test.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,26 @@ Note: This is NOT honored by other network related commands, eg `dist-tags`,
256256

257257

258258

259+
#### `cpu`
260+
261+
* Default: null
262+
* Type: null or String
263+
264+
Override CPU architecture of native modules to install. Acceptable values
265+
are same as `cpu` field of package.json, which comes from `process.arch`.
266+
267+
268+
269+
#### `os`
270+
271+
* Default: null
272+
* Type: null or String
273+
274+
Override OS of native modules to install. Acceptable values are same as `os`
275+
field of package.json, which comes from `process.platform`.
276+
277+
278+
259279
#### `workspace`
260280

261281
* Default:

deps/npm/docs/content/commands/npm-install.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,26 @@ Note: This is NOT honored by other network related commands, eg `dist-tags`,
646646
647647
648648
649+
#### `cpu`
650+
651+
* Default: null
652+
* Type: null or String
653+
654+
Override CPU architecture of native modules to install. Acceptable values
655+
are same as `cpu` field of package.json, which comes from `process.arch`.
656+
657+
658+
659+
#### `os`
660+
661+
* Default: null
662+
* Type: null or String
663+
664+
Override OS of native modules to install. Acceptable values are same as `os`
665+
field of package.json, which comes from `process.platform`.
666+
667+
668+
649669
#### `workspace`
650670
651671
* Default:

deps/npm/docs/content/commands/npm-ls.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ packages will *also* show the paths to the specified packages. For
2727
example, running `npm ls promzard` in npm's source tree will show:
2828

2929
```bash
30-
npm@10.0.0 /path/to/npm
30+
npm@10.1.0 /path/to/npm
3131
3232
3333
```

deps/npm/docs/content/commands/npm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Note: This command is unaware of workspaces.
1414

1515
### Version
1616

17-
10.0.0
17+
10.1.0
1818

1919
### Description
2020

deps/npm/docs/content/using-npm/config.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,16 @@ Run git commit hooks when using the `npm version` command.
345345

346346

347347

348+
#### `cpu`
349+
350+
* Default: null
351+
* Type: null or String
352+
353+
Override CPU architecture of native modules to install. Acceptable values
354+
are same as `cpu` field of package.json, which comes from `process.arch`.
355+
356+
357+
348358
#### `depth`
349359

350360
* Default: `Infinity` if `--all` is set, otherwise `1`
@@ -1038,6 +1048,16 @@ time.
10381048

10391049

10401050

1051+
#### `os`
1052+
1053+
* Default: null
1054+
* Type: null or String
1055+
1056+
Override OS of native modules to install. Acceptable values are same as `os`
1057+
field of package.json, which comes from `process.platform`.
1058+
1059+
1060+
10411061
#### `otp`
10421062

10431063
* Default: null

0 commit comments

Comments
 (0)