Skip to content

Commit 32832ad

Browse files
authored
Merge branch 'nodejs:main' into main
2 parents 22442f2 + fda0de4 commit 32832ad

File tree

166 files changed

+4373
-3613
lines changed

Some content is hidden

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

166 files changed

+4373
-3613
lines changed

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Set update schedule for GitHub Actions
2+
3+
version: 2
4+
updates:
5+
- package-ecosystem: github-actions
6+
directory: /
7+
schedule:
8+
interval: monthly
9+
open-pull-requests-limit: 10

.github/workflows/coverage-linux.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ jobs:
3737
if: github.event.pull_request.draft == false
3838
runs-on: ubuntu-latest
3939
steps:
40-
- uses: actions/checkout@v3
40+
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
4141
with:
4242
persist-credentials: false
4343
- name: Set up Python ${{ env.PYTHON_VERSION }}
44-
uses: actions/setup-python@v4
44+
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0
4545
with:
4646
python-version: ${{ env.PYTHON_VERSION }}
4747
- name: Environment Information
@@ -64,6 +64,6 @@ jobs:
6464
- name: Clean tmp
6565
run: rm -rf coverage/tmp && rm -rf out
6666
- name: Upload
67-
uses: codecov/codecov-action@v3
67+
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
6868
with:
6969
directory: ./coverage

.github/workflows/daily-wpt-fyi.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ jobs:
6262
ref: ${{ env.NIGHTLY_REF || steps.setup-node.outputs.node-version }}
6363
- name: Set env.NODE
6464
run: echo "NODE=$(which node)" >> $GITHUB_ENV
65-
- name: Set env.WPT_DAILY_REF
65+
- name: Set env.WPT_REVISION
6666
env:
6767
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68-
run: echo "WPT_DAILY_REF=$(gh api /repos/web-platform-tests/wpt/branches/epochs/daily --jq '.commit.sha')" >> $GITHUB_ENV
68+
run: echo "WPT_REVISION=$(gh api /repos/web-platform-tests/wpt/branches/epochs/daily --jq '.commit.sha')" >> $GITHUB_ENV
6969

7070
# replace checked out WPT with the synchronized branch
7171
- name: Remove stale WPT
@@ -78,10 +78,7 @@ jobs:
7878
persist-credentials: false
7979
path: test/fixtures/wpt
8080
clean: false
81-
ref: ${{ env.WPT_DAILY_REF }}
82-
- name: Set env.WPT_REVISION
83-
run: echo "WPT_REVISION=$(git rev-parse HEAD)" >> $GITHUB_ENV
84-
working-directory: test/fixtures/wpt
81+
ref: ${{ env.WPT_REVISION }}
8582

8683
- name: Run WPT and generate report
8784
run: make test-wpt-report || true

.github/workflows/tools.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,16 @@ jobs:
154154
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
155155
./tools/dep_updaters/update-ada.sh "$NEW_VERSION"
156156
fi
157+
- id: nghttp2
158+
subsystem: deps
159+
label: dependencies
160+
run: |
161+
NEW_VERSION=$(gh api repos/nghttp2/nghttp2/releases/latest -q '.tag_name|ltrimstr("v")')
162+
CURRENT_VERSION=$(grep "#define NGHTTP2_VERSION" ./deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h | sed -n "s/^.*VERSION \(.*\)/\1/p")
163+
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
164+
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
165+
./tools/update-nghttp2.sh "$NEW_VERSION"
166+
fi
157167
steps:
158168
- uses: actions/checkout@v3
159169
with:

AUTHORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3609,5 +3609,7 @@ Mohamed Akram <mohd-akram@users.noreply.github.com>
36093609
三咲智子 Kevin Deng <sxzz@sxzz.moe>
36103610
Nicolas DUBIEN <github@dubien.org>
36113611
richiemccoll <richie.mccoll@hotmail.co.uk>
3612+
sinkhaha <1468709106@qq.com>
3613+
Mert Can Altın <mertgold60@gmail.com>
36123614

36133615
# Generated by tools/update-authors.mjs

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
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_V19.md#19.6.1">19.6.1</a></b><br/>
38+
<b><a href="doc/changelogs/CHANGELOG_V19.md#19.7.0">19.7.0</a></b><br/>
39+
<a href="doc/changelogs/CHANGELOG_V19.md#19.6.1">19.6.1</a><br/>
3940
<a href="doc/changelogs/CHANGELOG_V19.md#19.6.0">19.6.0</a><br/>
4041
<a href="doc/changelogs/CHANGELOG_V19.md#19.5.0">19.5.0</a><br/>
4142
<a href="doc/changelogs/CHANGELOG_V19.md#19.4.0">19.4.0</a><br/>
@@ -46,7 +47,8 @@ release.
4647
<a href="doc/changelogs/CHANGELOG_V19.md#19.0.0">19.0.0</a><br/>
4748
</td>
4849
<td valign="top">
49-
<b><a href="doc/changelogs/CHANGELOG_V18.md#18.14.1">18.14.1</a></b><br/>
50+
<b><a href="doc/changelogs/CHANGELOG_V18.md#18.14.2">18.14.2</a></b><br/>
51+
<a href="doc/changelogs/CHANGELOG_V18.md#18.14.1">18.14.1</a><br/>
5052
<a href="doc/changelogs/CHANGELOG_V18.md#18.14.0">18.14.0</a><br/>
5153
<a href="doc/changelogs/CHANGELOG_V18.md#18.13.0">18.13.0</a><br/>
5254
<a href="doc/changelogs/CHANGELOG_V18.md#18.12.1">18.12.1</a><br/>

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,9 @@ DOCBUILDSTAMP_PREREQS = tools/doc/addon-verify.mjs doc/api/addons.md
368368
ifeq ($(OSTYPE),aix)
369369
DOCBUILDSTAMP_PREREQS := $(DOCBUILDSTAMP_PREREQS) out/$(BUILDTYPE)/node.exp
370370
endif
371+
ifeq ($(OSTYPE),os400)
372+
DOCBUILDSTAMP_PREREQS := $(DOCBUILDSTAMP_PREREQS) out/$(BUILDTYPE)/node.exp
373+
endif
371374

372375
node_use_openssl = $(call available-node,"-p" \
373376
"process.versions.openssl != undefined")

benchmark/assert/deepequal-buffer.js

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,47 @@ const bench = common.createBenchmark(main, {
66
n: [2e4],
77
len: [1e2, 1e3],
88
strict: [0, 1],
9-
method: ['deepEqual', 'notDeepEqual'],
9+
arrayBuffer: [0, 1],
10+
method: ['deepEqual', 'notDeepEqual', 'unequal_length'],
11+
}, {
12+
combinationFilter: (p) => {
13+
return p.strict === 1 || p.method === 'deepEqual';
14+
},
1015
});
1116

12-
function main({ len, n, method, strict }) {
13-
const data = Buffer.allocUnsafe(len + 1);
14-
const actual = Buffer.alloc(len);
15-
const expected = Buffer.alloc(len);
16-
const expectedWrong = Buffer.alloc(len + 1);
17-
data.copy(actual);
18-
data.copy(expected);
19-
data.copy(expectedWrong);
17+
function main({ len, n, method, strict, arrayBuffer }) {
18+
let actual = Buffer.alloc(len);
19+
let expected = Buffer.alloc(len + Number(method === 'unequal_length'));
20+
21+
22+
if (method === 'unequal_length') {
23+
method = 'notDeepEqual';
24+
}
25+
26+
for (let i = 0; i < len; i++) {
27+
actual.writeInt8(i % 128, i);
28+
expected.writeInt8(i % 128, i);
29+
}
30+
31+
if (method.includes('not')) {
32+
const position = Math.floor(len / 2);
33+
expected[position] = expected[position] + 1;
34+
}
2035

2136
if (strict) {
2237
method = method.replace('eep', 'eepStrict');
2338
}
39+
2440
const fn = assert[method];
25-
const value2 = method.includes('not') ? expectedWrong : expected;
41+
42+
if (arrayBuffer) {
43+
actual = actual.buffer;
44+
expected = expected.buffer;
45+
}
2646

2747
bench.start();
2848
for (let i = 0; i < n; ++i) {
29-
fn(actual, value2);
49+
fn(actual, expected);
3050
}
3151
bench.end(n);
3252
}

benchmark/assert/deepequal-object.js

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,21 @@ const common = require('../common.js');
44
const assert = require('assert');
55

66
const bench = common.createBenchmark(main, {
7-
n: [5e3],
8-
size: [1e2, 1e3, 5e4],
9-
strict: [0, 1],
7+
n: [25, 2e2, 2e3],
8+
size: [1e2, 1e3, 1e4],
9+
strict: [1],
1010
method: ['deepEqual', 'notDeepEqual'],
11+
}, {
12+
combinationFilter: (p) => {
13+
return p.size === 1e4 && p.n === 25 ||
14+
p.size === 1e3 && p.n === 2e2 ||
15+
p.size === 1e2 && p.n === 2e3 ||
16+
p.size === 1;
17+
},
1118
});
1219

13-
function createObj(source, add = '') {
14-
return source.map((n) => ({
20+
function createObj(size, add = '') {
21+
return Array.from({ length: size }, (n) => ({
1522
foo: 'yarp',
1623
nope: {
1724
bar: `123${add}`,
@@ -24,22 +31,17 @@ function createObj(source, add = '') {
2431
}
2532

2633
function main({ size, n, method, strict }) {
27-
const len = Math.min(Math.ceil(n / size), 20);
28-
29-
const source = Array.apply(null, Array(size));
30-
const actual = createObj(source);
31-
const expected = createObj(source);
32-
const expectedWrong = createObj(source, '4');
33-
3434
if (strict) {
3535
method = method.replace('eep', 'eepStrict');
3636
}
3737
const fn = assert[method];
38-
const value2 = method.includes('not') ? expectedWrong : expected;
38+
39+
const actual = createObj(size);
40+
const expected = method.includes('not') ? createObj(size, '4') : createObj(size);
3941

4042
bench.start();
41-
for (let i = 0; i < len; ++i) {
42-
fn(actual, value2);
43+
for (let i = 0; i < n; ++i) {
44+
fn(actual, expected);
4345
}
44-
bench.end(len);
46+
bench.end(n);
4547
}

benchmark/assert/deepequal-prims-and-objs-big-loop.js

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,77 @@
22
const common = require('../common.js');
33
const assert = require('assert');
44

5+
const circular = {};
6+
circular.circular = circular;
7+
const circular2 = {};
8+
circular2.circular = circular2;
9+
const notCircular = {};
10+
notCircular.circular = {};
11+
512
const primValues = {
6-
'string': 'a',
7-
'number': 1,
8-
'object': { 0: 'a' },
13+
'string': 'abcdef',
14+
'number': 1_000,
15+
'boolean': true,
16+
'object': { property: 'abcdef' },
17+
'object_other_property': { property: 'abcdef' },
18+
'array': [1, 2, 3],
19+
'set_object': new Set([[1]]),
20+
'set_simple': new Set([1, 2, 3]),
21+
'circular': circular,
22+
'empty_object': {},
23+
'regexp': /abc/i,
24+
'date': new Date(),
25+
};
26+
27+
const primValues2 = {
28+
'object': { property: 'abcdef' },
929
'array': [1, 2, 3],
30+
'set_object': new Set([[1]]),
31+
'set_simple': new Set([1, 3, 2]),
32+
'circular': circular2,
33+
'empty_object': {},
34+
'regexp': /abc/i,
35+
'date': new Date(primValues.date),
36+
};
37+
38+
const primValuesUnequal = {
39+
'string': 'abcdez',
40+
'number': 1_001,
41+
'boolean': false,
42+
'object': { property2: 'abcdef' },
43+
'array': [1, 3, 2],
44+
'set_object': new Set([[2]]),
45+
'set_simple': new Set([1, 4, 2]),
46+
'circular': notCircular,
47+
'empty_object': [],
48+
'regexp': /abc/g,
49+
'date': new Date(primValues.date.getTime() + 1),
1050
};
1151

1252
const bench = common.createBenchmark(main, {
1353
primitive: Object.keys(primValues),
14-
n: [2e4],
54+
n: [1e5],
1555
strict: [0, 1],
1656
method: ['deepEqual', 'notDeepEqual'],
57+
}, {
58+
combinationFilter: (p) => {
59+
return p.strict === 1 || p.method === 'deepEqual';
60+
},
1761
});
1862

1963
function main({ n, primitive, method, strict }) {
2064
const prim = primValues[primitive];
21-
const actual = prim;
22-
const expected = prim;
23-
const expectedWrong = 'b';
65+
const actual = primValues2[primitive] ?? prim;
66+
const expected = method.includes('not') ? primValuesUnequal[primitive] : prim;
2467

2568
if (strict) {
2669
method = method.replace('eep', 'eepStrict');
2770
}
2871
const fn = assert[method];
29-
const value2 = method.includes('not') ? expectedWrong : expected;
3072

3173
bench.start();
3274
for (let i = 0; i < n; ++i) {
33-
fn([actual], [value2]);
75+
fn(actual, expected);
3476
}
3577
bench.end(n);
3678
}

benchmark/assert/deepequal-prims-and-objs-big-array-set.js renamed to benchmark/assert/deepequal-simple-array-and-set.js

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,10 @@ const common = require('../common.js');
44
const { deepEqual, deepStrictEqual, notDeepEqual, notDeepStrictEqual } =
55
require('assert');
66

7-
const primValues = {
8-
'string': 'a',
9-
'number': 1,
10-
'object': { 0: 'a' },
11-
'array': [1, 2, 3],
12-
};
13-
147
const bench = common.createBenchmark(main, {
15-
primitive: Object.keys(primValues),
16-
n: [25],
17-
len: [2e4],
18-
strict: [0, 1],
8+
n: [5e2],
9+
len: [1e4],
10+
strict: [1],
1911
method: [
2012
'deepEqual_Array',
2113
'notDeepEqual_Array',
@@ -32,38 +24,32 @@ function run(fn, n, actual, expected) {
3224
bench.end(n);
3325
}
3426

35-
function main({ n, len, primitive, method, strict }) {
36-
const prim = primValues[primitive];
27+
function main({ n, len, method, strict }) {
3728
const actual = [];
3829
const expected = [];
39-
const expectedWrong = [];
4030

41-
for (let x = 0; x < len; x++) {
42-
actual.push(prim);
43-
expected.push(prim);
44-
expectedWrong.push(prim);
31+
for (let i = 0; i < len; i++) {
32+
actual.push(i);
33+
expected.push(i);
34+
}
35+
if (method.includes('not')) {
36+
expected[len - 1] += 1;
4537
}
46-
expectedWrong.pop();
47-
expectedWrong.push('b');
48-
49-
// Note: primitives are only added once to a set
50-
const actualSet = new Set(actual);
51-
const expectedSet = new Set(expected);
52-
const expectedWrongSet = new Set(expectedWrong);
5338

5439
switch (method) {
5540
case 'deepEqual_Array':
5641
run(strict ? deepStrictEqual : deepEqual, n, actual, expected);
5742
break;
5843
case 'notDeepEqual_Array':
59-
run(strict ? notDeepStrictEqual : notDeepEqual, n, actual, expectedWrong);
44+
run(strict ? notDeepStrictEqual : notDeepEqual, n, actual, expected);
6045
break;
6146
case 'deepEqual_Set':
62-
run(strict ? deepStrictEqual : deepEqual, n, actualSet, expectedSet);
47+
run(strict ? deepStrictEqual : deepEqual,
48+
n, new Set(actual), new Set(expected));
6349
break;
6450
case 'notDeepEqual_Set':
6551
run(strict ? notDeepStrictEqual : notDeepEqual,
66-
n, actualSet, expectedWrongSet);
52+
n, new Set(actual), new Set(expected));
6753
break;
6854
default:
6955
throw new Error(`Unsupported method "${method}"`);

0 commit comments

Comments
 (0)