Skip to content

Commit

Permalink
http2: simplify custom promisify
Browse files Browse the repository at this point in the history
This is just a small refactoring.

Refs: nodejs#20830 (comment)
  • Loading branch information
BridgeAR committed Jul 16, 2018
1 parent bd1f355 commit ce447c3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2746,9 +2746,7 @@ function connect(authority, options, listener) {
// Support util.promisify
Object.defineProperty(connect, promisify.custom, {
value: (authority, options) => {
return new Promise((resolve) => {
const server = connect(authority, options, () => resolve(server));
});
return new Promise((resolve) => resolve(connect(authority, options)));
}
});

Expand Down

0 comments on commit ce447c3

Please sign in to comment.