function emitEvent (name, p) {
      var browserEventName = 'on' + name.toLowerCase()
          , browserHandler = root[browserEventName];

      if (process && process.listeners(name).length)
          name === $unhandledRejection ?
              process.emit(name, p._v, p) : process.emit(name, p);
      else if (browserHandler)
          browserHandler({ reason: p._v, promise: p });
      else
          Yaku[name](p._v, p);
  }
Resolve the value returned by onFulfilled or onRejected.
@private
@param {Yaku} p1
@param {Yaku} p2