Skip to content

Commit ce447c3

Browse files
committed
http2: simplify custom promisify
This is just a small refactoring. Refs: nodejs#20830 (comment)
1 parent bd1f355 commit ce447c3

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

lib/internal/http2/core.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2746,9 +2746,7 @@ function connect(authority, options, listener) {
27462746
// Support util.promisify
27472747
Object.defineProperty(connect, promisify.custom, {
27482748
value: (authority, options) => {
2749-
return new Promise((resolve) => {
2750-
const server = connect(authority, options, () => resolve(server));
2751-
});
2749+
return new Promise((resolve) => resolve(connect(authority, options)));
27522750
}
27532751
});
27542752

0 commit comments

Comments
 (0)