Skip to content

Commit f2b01cb

Browse files
tflanaganTrott
authored andcommitted
child_process: defer error to next tick
PR-URL: #4670 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
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

Lines changed: 2 additions & 2 deletions
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)