diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bun.js/child_process.exports.js | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/bun.js/child_process.exports.js b/src/bun.js/child_process.exports.js index 39f9380de..0ee72fe4c 100644 --- a/src/bun.js/child_process.exports.js +++ b/src/bun.js/child_process.exports.js @@ -1080,7 +1080,6 @@ export class ChildProcess extends EventEmitter { this.#encoding = options.encoding || undefined; this.#stdioOptions = bunStdio; - var hasEmittedSpawn = false; this.#handle = Bun.spawn({ cmd: spawnargs, stdin: bunStdio[0], @@ -1092,22 +1091,18 @@ export class ChildProcess extends EventEmitter { this.#handle = handle; this.pid = this.#handle.pid; - if (!hasEmittedSpawn) { - hasEmittedSpawn = true; - process.nextTick(onSpawnNT, this); - process.nextTick((exitCode, signalCode, err) => this.#handleOnExit(exitCode, signalCode, err)); - } else { - this.#handleOnExit(exitCode, signalCode, err); - } + process.nextTick( + (exitCode, signalCode, err) => this.#handleOnExit(exitCode, signalCode, err), + exitCode, + signalCode, + err, + ); }, lazy: true, }); this.pid = this.#handle.pid; - if (!hasEmittedSpawn) { - process.nextTick(onSpawnNT, this); - hasEmittedSpawn = true; - } + onSpawnNT(this); // const ipc = stdio.ipc; // const ipcFd = stdio.ipcFd; |