code: function well(promiseOrValue, onFulfilled, onRejected, onProgress) {
              // Get a trusted promise for the input promiseOrValue, and then
              // register promise handlers
              return resolve(promiseOrValue).then(onFulfilled, onRejected, onProgress);
          }
docs: Determine if a thing is a promise 
  Register an observer for a promise or immediate value.
  
  @param {*} promiseOrValue
  @param {function?} [onFulfilled] callback to be called when promiseOrValue is
  successfully fulfilled.  If promiseOrValue is an immediate value, callback
  will be invoked immediately.
  @param {function?} [onRejected] callback to be called when promiseOrValue is
  rejected.
  @param {function?} [onProgress] callback to be called when progress updates
  are issued for promiseOrValue.
  @returns {Promise} a new {@link Promise} that will complete with the return
  value of callback or errback or the completion value of promiseOrValue if
  callback and/or errback is not supplied.