Skip to content

Commit 01ccc11

Browse files
committed
http2: give name to promisified connect()
1 parent e61937b commit 01ccc11

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/internal/http2/core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3369,7 +3369,7 @@ function connect(authority, options, listener) {
33693369
// Support util.promisify
33703370
ObjectDefineProperty(connect, promisify.custom, {
33713371
__proto__: null,
3372-
value: (authority, options) => {
3372+
value: function connect(authority, options) { // eslint-disable-line func-name-matching
33733373
return new Promise((resolve, reject) => {
33743374
const server = connect(authority, options, () => {
33753375
server.removeListener('error', reject);

test/parallel/test-util-promisify-custom-names.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import fs from 'node:fs';
99
import readline from 'node:readline';
1010
import stream from 'node:stream';
1111
import timers from 'node:timers';
12+
import http2 from 'node:http2';
1213

1314

1415
assert.strictEqual(
@@ -38,3 +39,8 @@ assert.strictEqual(
3839
promisify(timers.setTimeout).name,
3940
'setTimeout'
4041
);
42+
43+
assert.strictEqual(
44+
promisify(http2.connect).name,
45+
'connect'
46+
);

0 commit comments

Comments
 (0)