harmony.js
// 25.4.1.8 UpdatePromiseFromPotentialThenable ( x, promiseCapability)
25.4.1.8 UpdatePromiseFromPotentialThenable ( x, promiseCapability)
25 . 4 . 1 . 8 UpdatePromiseFromPotentialThenable ( x promiseCapability )
function UpdatePromiseFromPotentialThenable(x, promiseCapability) {
      if (Type(x) !== 'object') return "not a thenable";
      try {
        var then = x["then"];
      } catch (_) {
        var rejectResult = promiseCapability['[[Reject]]'].call(undefined, then);
        return nothing;
      }
      if (!IsCallable(then)) return "not a thenable";
      try {
        var thenCallResult = then.call(x, promiseCapability['[[Resolve]]'], promiseCapability['[[Reject]]']);
      } catch (_) {
        rejectResult = promiseCapability['[[Reject]]'].call(undefined, thenCallResult);
        return nothing;
      }
      return nothing;
    }
function UpdatePromiseFromPotentialThenable ( x , promiseCapability ) { if ( Type ( x ) !== 'object' ) return "not a thenable" ; try { var then = x [ "then" ] ; } catch ( _ ) { var rejectResult = promiseCapability [ '[[Reject]]' ] . call ( undefined , then ) ; return nothing ; } if ( ! IsCallable ( then ) ) return "not a thenable" ; try { var thenCallResult = then . call ( x , promiseCapability [ '[[Resolve]]' ] , promiseCapability [ '[[Reject]]' ] ) ; } catch ( _ ) { rejectResult = promiseCapability [ '[[Reject]]' ] . call ( undefined , thenCallResult ) ; return nothing ; } return nothing ; }
25.4.1.8 UpdatePromiseFromPotentialThenable ( x, promiseCapability)
25 . 4 . 1 . 8 UpdatePromiseFromPotentialThenable ( x promiseCapability )