docs: function doResolve(promise, resolve, reject, value, context) {
    var _reject = reject;
    var then;
    var _resolve;
    try {
      if (value === promise) {
        throw new TypeError('Cannot fulfill promise with itself');
      }
      var isObj = isObject(value);
      if (isObj && value instanceof promise.constructor) {
        adopt(promise, value._state, value._value, value);
      } else if (isObj && (then = value.then) && isFunction(then)) {
        _resolve = function(value) {
          _resolve = _reject = noop;
          doResolve(promise, resolve, reject, value, value);
        };
        _reject = function(reason) {
          _resolve = _reject = noop;
          reject(reason);
        };
        then.call(
          context,
          function(value) { _resolve(value); },
          function(reason) { _reject(reason); }
        );
      } else {
        resolve(value);
      }
    } catch (e) {
      _reject(e);
    }
  }