(promises, fn, accum, _each)
| 3184 | var tryCatch = util.tryCatch; |
| 3185 | var errorObj = util.errorObj; |
| 3186 | function ReductionPromiseArray(promises, fn, accum, _each) { |
| 3187 | this.constructor$(promises); |
| 3188 | this._promise._captureStackTrace(); |
| 3189 | this._preservedValues = _each === INTERNAL ? [] : null; |
| 3190 | this._zerothIsAccum = (accum === undefined); |
| 3191 | this._gotAccum = false; |
| 3192 | this._reducingIndex = (this._zerothIsAccum ? 1 : 0); |
| 3193 | this._valuesPhase = undefined; |
| 3194 | var maybePromise = tryConvertToPromise(accum, this._promise); |
| 3195 | var rejected = false; |
| 3196 | var isPromise = maybePromise instanceof Promise; |
| 3197 | if (isPromise) { |
| 3198 | maybePromise = maybePromise._target(); |
| 3199 | if (maybePromise._isPending()) { |
| 3200 | maybePromise._proxyPromiseArray(this, -1); |
| 3201 | } else if (maybePromise._isFulfilled()) { |
| 3202 | accum = maybePromise._value(); |
| 3203 | this._gotAccum = true; |
| 3204 | } else { |
| 3205 | this._reject(maybePromise._reason()); |
| 3206 | rejected = true; |
| 3207 | } |
| 3208 | } |
| 3209 | if (!(isPromise || this._zerothIsAccum)) this._gotAccum = true; |
| 3210 | this._callback = fn; |
| 3211 | this._accum = accum; |
| 3212 | if (!rejected) this._init$(undefined, -5); |
| 3213 | } |
| 3214 | util.inherits(ReductionPromiseArray, PromiseArray); |
| 3215 | |
| 3216 | ReductionPromiseArray.prototype._init = function () {}; |
nothing calls this directly
no test coverage detected
searching dependent graphs…