lib/core/process.js
function interceptDeath(process, events) {
    var closeEvent = helpers.support.close;

    // all channels are closed
    process.once(closeEvent ? 'close' : 'exit', events.close);

    // the process died
    if (closeEvent) {
      process.once('exit', events.exit);
    } else {

      // intercept internal onexit call
      var internalHandle = process._internal.onexit;
      process._internal.onexit = function () {
        events.exit();
        internalHandle.apply(this, arguments);
      };
    }
  }
function interceptDeath(process, events) {
    var closeEvent = helpers.support.close;

    // all channels are closed
    process.once(closeEvent ? 'close' : 'exit', events.close);

    // the process died
    if (closeEvent) {
      process.once('exit', events.exit);
    } else {

      // intercept internal onexit call
      var internalHandle = process._internal.onexit;
      process._internal.onexit = function () {
        events.exit();
        internalHandle.apply(this, arguments);
      };
    }
  }
function interceptDeath ( process , events ) { var closeEvent = helpers . support . close ; // all channels are closed process . once ( closeEvent ? 'close' : 'exit' , events . close ) ; // the process died if ( closeEvent ) { process . once ( 'exit' , events . exit ) ; } else { // intercept internal onexit call var internalHandle = process . _internal . onexit ; process . _internal . onexit = function ( ) { events . exit ( ) ; internalHandle . apply ( this , arguments ) ; } ; } }
An helper function there will intercept internal exit event if necessary
An helper function there will intercept internal exit event if necessary