lib/WorkerHandler.js
function resolveForkOptions(opts) {
  opts = opts || {};

  var processExecArgv = process.execArgv.join(' ');
  var inspectorActive = processExecArgv.indexOf('--inspect') !== -1;
  var debugBrk = processExecArgv.indexOf('--debug-brk') !== -1;

  var execArgv = [];
  if (inspectorActive) {
    execArgv.push('--inspect=' + opts.debugPort);

    if (debugBrk) {
      execArgv.push('--debug-brk');
    }
  }

  return assign({}, opts, {
    forkArgs: opts.forkArgs,
    forkOpts: assign({}, opts.forkOpts, {
      execArgv: (opts.forkOpts && opts.forkOpts.execArgv || [])
      .concat(execArgv)
    })
  });
}
function resolveForkOptions(opts) {
  opts = opts || {};

  var processExecArgv = process.execArgv.join(' ');
  var inspectorActive = processExecArgv.indexOf('--inspect') !== -1;
  var debugBrk = processExecArgv.indexOf('--debug-brk') !== -1;

  var execArgv = [];
  if (inspectorActive) {
    execArgv.push('--inspect=' + opts.debugPort);

    if (debugBrk) {
      execArgv.push('--debug-brk');
    }
  }

  return assign({}, opts, {
    forkArgs: opts.forkArgs,
    forkOpts: assign({}, opts.forkOpts, {
      execArgv: (opts.forkOpts && opts.forkOpts.execArgv || [])
      .concat(execArgv)
    })
  });
}
function resolveForkOptions ( opts ) { opts = opts || { } ; var processExecArgv = process . execArgv . join ( ' ' ) ; var inspectorActive = processExecArgv . indexOf ( '--inspect' ) !== - 1 ; var debugBrk = processExecArgv . indexOf ( '--debug-brk' ) !== - 1 ; var execArgv = [ ] ; if ( inspectorActive ) { execArgv . push ( '--inspect=' + opts . debugPort ) ; if ( debugBrk ) { execArgv . push ( '--debug-brk' ) ; } } return assign ( { } , opts , { forkArgs : opts . forkArgs , forkOpts : assign ( { } , opts . forkOpts , { execArgv : ( opts . forkOpts && opts . forkOpts . execArgv || [ ] ) . concat ( execArgv ) } ) } ) ; }
add debug flags to child processes if the node inspector is active
add debug flags to child processes if the node inspector is active