function when(promiseOrValue, onFulfilled, onRejected, onProgress) {
		// Get a trusted promise for the input promiseOrValue, and then
		// register promise handlers
		return cast(promiseOrValue).then(onFulfilled, onRejected, onProgress);
	}
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.