Skip to content

Commit f2b01cb

Browse files
tflanaganTrott
authored andcommitted
child_process: defer error to next tick
PR-URL: #4670 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ilkka Myller <[email protected]>
1 parent 5ea25d2 commit f2b01cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/child_process.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ function setupChannel(target, channel) {
599599
if (typeof callback === 'function') {
600600
process.nextTick(callback, ex);
601601
} else {
602-
this.emit('error', ex); // FIXME(bnoordhuis) Defer to next tick.
602+
process.nextTick(() => this.emit('error', ex));
603603
}
604604
return false;
605605
};
@@ -713,7 +713,7 @@ function setupChannel(target, channel) {
713713
if (typeof callback === 'function') {
714714
process.nextTick(callback, ex);
715715
} else {
716-
this.emit('error', ex); // FIXME(bnoordhuis) Defer to next tick.
716+
process.nextTick(() => this.emit('error', ex));
717717
}
718718
}
719719
}

0 commit comments

Comments
 (0)