From f2b01cba7b48c2410a692fe1cb29b2e88a6c5cab Mon Sep 17 00:00:00 2001 From: Tristian Flanagan Date: Wed, 13 Jan 2016 10:00:19 -0500 Subject: [PATCH] child_process: defer error to next tick PR-URL: https://github.com/nodejs/node/pull/4670 Reviewed-By: Colin Ihrig Reviewed-By: Santiago Gimeno Reviewed-By: Ben Noordhuis Reviewed-By: Rich Trott Reviewed-By: Ilkka Myller --- lib/internal/child_process.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)); } } }