diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index d2856df489185f..69aeda06510a0c 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -599,7 +599,7 @@ function setupChannel(target, channel) { if (typeof callback === 'function') { process.nextTick(callback, ex); } else { - this.emit('error', ex); // FIXME(bnoordhuis) Defer to next tick. + process.nextTick(() => this.emit('error', ex)); } return false; }; @@ -713,7 +713,7 @@ function setupChannel(target, channel) { if (typeof callback === 'function') { process.nextTick(callback, ex); } else { - this.emit('error', ex); // FIXME(bnoordhuis) Defer to next tick. + process.nextTick(() => this.emit('error', ex)); } } }