code: function rejectPromise(promise, value) {
    if (promise.state !== PENDING) {return;}
  
    setValue(promise, value);
    setState(promise, UNFULFILLED);
  
    setImmediate(function() {
      setState(promise, FAILED);
      invokeFunctions(promise);
    });
  }
docs: Reject the given promise  @param {promise} the promise to reject @param {value} the value of the promise @return void