| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6af5358 commit 6816d77
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,6 +46,7 @@ const { | |||
| 46 | 46 | } = primordials; | |
| 47 | 47 | ||
| 48 | 48 | const { | |
| 49 | + assignFunctionName, | ||
| 49 | 50 | convertToValidSignal, | |
| 50 | 51 | getSystemErrorName, | |
| 51 | 52 | kEmptyObject, | |
@@ -236,7 +237,7 @@ function exec(command, options, callback) { | |||
| 236 | 237 | } | |
| 237 | 238 | ||
| 238 | 239 | const customPromiseExecFunction = (orig) => { | |
| 239 | - return (...args) => { | ||
| 240 | + return assignFunctionName(orig.name, function(...args) { | ||
| 240 | 241 | const { promise, resolve, reject } = PromiseWithResolvers(); | |
| 241 | 242 | ||
| 242 | 243 | promise.child = orig(...args, (err, stdout, stderr) => { | |
@@ -250,7 +251,7 @@ const customPromiseExecFunction = (orig) => { | |||
| 250 | 251 | }); | |
| 251 | 252 | ||
| 252 | 253 | return promise; | |
| 253 | - }; | ||
| 254 | + }); | ||
| 254 | 255 | }; | |
| 255 | 256 | ||
| 256 | 257 | ObjectDefineProperty(exec, promisify.custom, { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,6 +9,7 @@ import fs from 'node:fs'; | |||
| 9 | 9 | import readline from 'node:readline'; | |
| 10 | 10 | import stream from 'node:stream'; | |
| 11 | 11 | import timers from 'node:timers'; | |
| 12 | + import child_process from 'node:child_process'; | ||
| 12 | 13 | ||
| 13 | 14 | ||
| 14 | 15 | assert.strictEqual( | |
@@ -38,3 +39,12 @@ assert.strictEqual( | |||
| 38 | 39 | promisify(timers.setTimeout).name, | |
| 39 | 40 | 'setTimeout' | |
| 40 | 41 | ); | |
| 42 | + | ||
| 43 | + assert.strictEqual( | ||
| 44 | + promisify(child_process.exec).name, | ||
| 45 | + 'exec' | ||
| 46 | + ); | ||
| 47 | + assert.strictEqual( | ||
| 48 | + promisify(child_process.execFile).name, | ||
| 49 | + 'execFile' | ||
| 50 | + ); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments