src/third_party/v8-3.25/src/promise.js
// Multi-unwrapped chaining with thenable coercion.
Multi-unwrapped chaining with thenable coercion.
Multi - unwrapped chaining with thenable coercion .
function PromiseThen(onResolve, onReject) {
  onResolve =
    IS_NULL_OR_UNDEFINED(onResolve) ? PromiseIdResolveHandler : onResolve;
  onReject =
    IS_NULL_OR_UNDEFINED(onReject) ? PromiseIdRejectHandler : onReject;
  var that = this;
  var constructor = this.constructor;
  return this.chain(
    function(x) {
      x = PromiseCoerce(constructor, x);
      return x === that ? onReject(MakeTypeError('promise_cyclic', [x])) :
             IsPromise(x) ? x.then(onResolve, onReject) : onResolve(x);
    },
    onReject
  );
}
function PromiseThen ( onResolve , onReject ) { onResolve = IS_NULL_OR_UNDEFINED ( onResolve ) ? PromiseIdResolveHandler : onResolve ; onReject = IS_NULL_OR_UNDEFINED ( onReject ) ? PromiseIdRejectHandler : onReject ; var that = this ; var constructor = this . constructor ; return this . chain ( function ( x ) { x = PromiseCoerce ( constructor , x ) ; return x === that ? onReject ( MakeTypeError ( 'promise_cyclic' , [ x ] ) ) : IsPromise ( x ) ? x . then ( onResolve , onReject ) : onResolve ( x ) ; } , onReject ) ; }
Multi-unwrapped chaining with thenable coercion.
Multi - unwrapped chaining with thenable coercion .