src/polyfill/promise.js
function invokeFunction(promise, child, func) {
  var value = promise.value;
  var state = promise.state;

  // If we have a function to run, run it
  if (typeof func === 'function') {
    try {
      value = func(value);
    } catch (err) {
      rejectPromise(child, err);
      return;
    }

    resolvePromise(child, value);
  }

  else if (state === FULFILLED) {
    resolvePromise(child, value);
  }

  else if (state === FAILED) {
    rejectPromise(child, value);
  }
}
function invokeFunction(promise, child, func) {
  var value = promise.value;
  var state = promise.state;

  // If we have a function to run, run it
  if (typeof func === 'function') {
    try {
      value = func(value);
    } catch (err) {
      rejectPromise(child, err);
      return;
    }

    resolvePromise(child, value);
  }

  else if (state === FULFILLED) {
    resolvePromise(child, value);
  }

  else if (state === FAILED) {
    rejectPromise(child, value);
  }
}
function invokeFunction ( promise , child , func ) { var value = promise . value ; var state = promise . state ; // If we have a function to run, run it if ( typeof func === 'function' ) { try { value = func ( value ) ; } catch ( err ) { rejectPromise ( child , err ) ; return ; } resolvePromise ( child , value ) ; } else if ( state === FULFILLED ) { resolvePromise ( child , value ) ; } else if ( state === FAILED ) { rejectPromise ( child , value ) ; } }
Invoke one specific function for the promise  @param {promise} the promise the function belongs too (that .then was called on) @param {child} the promise return from the .then call; the next in line @param {func} the function to call @return void
Invoke one specific function for the promise