* Get a trusted promise for x, or by transforming x with onFulfilled * * @param {*} x * @param {function?} onFulfilled callback to be called when x is * successfully fulfilled. If promiseOrValue is an immediate value, callback * will be invoked immediately. * @param {function?} onRe
(x, onFulfilled, onRejected, onProgress)
| 80 | * callback and/or errback is not supplied. |
| 81 | */ |
| 82 | function when(x, onFulfilled, onRejected, onProgress) { |
| 83 | var p = Promise.resolve(x); |
| 84 | if (arguments.length < 2) { |
| 85 | return p; |
| 86 | } |
| 87 | |
| 88 | return p.then(onFulfilled, onRejected, onProgress); |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * Creates a new promise whose fate is determined by resolver. |
no outgoing calls
no test coverage detected
searching dependent graphs…