| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -540,11 +540,14 @@ primordials.SafePromiseAllReturnVoid = (promises, mapFn) => | |||
| 540 | 540 | new Promise((resolve, reject) => { | |
| 541 | 541 | let pendingPromises = promises.length; | |
| 542 | 542 | if (pendingPromises === 0) resolve(); | |
| 543 | + const onFulfilled = () => { | ||
| 544 | + if (--pendingPromises === 0) { | ||
| 545 | + resolve(); | ||
| 546 | + } | ||
| 547 | + }; | ||
| 543 | 548 | for (let i = 0; i < promises.length; i++) { | |
| 544 | 549 | const promise = mapFn != null ? mapFn(promises[i], i) : promises[i]; | |
| 545 | - PromisePrototypeThen(PromiseResolve(promise), () => { | ||
| 546 | - if (--pendingPromises === 0) resolve(); | ||
| 547 | - }, reject); | ||
| 550 | + PromisePrototypeThen(PromiseResolve(promise), onFulfilled, reject); | ||
| 548 | 551 | } | |
| 549 | 552 | }); | |
| 550 | 553 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments