| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7dabf07 commit 8f1aee9
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,6 +25,7 @@ const { | |||
| 25 | 25 | } = primordials; | |
| 26 | 26 | ||
| 27 | 27 | const { | |
| 28 | + assignFunctionName, | ||
| 28 | 29 | assertCrypto, | |
| 29 | 30 | customInspectSymbol: kInspect, | |
| 30 | 31 | kEmptyObject, | |
@@ -3395,7 +3396,7 @@ function connect(authority, options, listener) { | |||
| 3395 | 3396 | // Support util.promisify | |
| 3396 | 3397 | ObjectDefineProperty(connect, promisify.custom, { | |
| 3397 | 3398 | __proto__: null, | |
| 3398 | - value: (authority, options) => { | ||
| 3399 | + value: assignFunctionName('connect', function(authority, options) { | ||
| 3399 | 3400 | return new Promise((resolve, reject) => { | |
| 3400 | 3401 | const server = connect(authority, options, () => { | |
| 3401 | 3402 | server.removeListener('error', reject); | |
@@ -3404,7 +3405,7 @@ ObjectDefineProperty(connect, promisify.custom, { | |||
| 3404 | 3405 | ||
| 3405 | 3406 | server.once('error', reject); | |
| 3406 | 3407 | }); | |
| 3407 | - }, | ||
| 3408 | + }), | ||
| 3408 | 3409 | }); | |
| 3409 | 3410 | ||
| 3410 | 3411 | function createSecureServer(options, handler) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - import '../common/index.mjs'; | ||
| 1 | + import { hasCrypto } from '../common/index.mjs'; | ||
| 2 | 2 | import assert from 'node:assert'; | |
| 3 | 3 | import { promisify } from 'node:util'; | |
| 4 | 4 | ||
@@ -48,3 +48,11 @@ assert.strictEqual( | |||
| 48 | 48 | promisify(child_process.execFile).name, | |
| 49 | 49 | 'execFile' | |
| 50 | 50 | ); | |
| 51 | + | ||
| 52 | + if (hasCrypto) { | ||
| 53 | + const http2 = await import('node:http2'); | ||
| 54 | + assert.strictEqual( | ||
| 55 | + promisify(http2.connect).name, | ||
| 56 | + 'connect' | ||
| 57 | + ); | ||
| 58 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments