PulseAugur
中
实时 12:19:24

JavaScript Promise.all 在单个失败时丢弃成功的结果

JavaScript 的 `Promise.all` 函数存在一个严重缺陷,即如果批处理中的任何一个 promise 失败,它就会丢弃所有成功的结果。这一行为通过一个涉及十个异步调用的测试用例得到了证明,其中 `Promise.all` 在一个调用失败时返回了零个结果,尽管其他九个调用都成功了。相比之下,`Promise.allSettled` 成功捕获了所有九个成功的结果,并在所有 promise 完成后才返回一份全面的状态报告。 AI

排序理由 该条目讨论的是 JavaScript 编程构造的特定行为,而不是新版本发布或重要的行业事件。

在 dev.to — Claude Code tag 阅读 →

AI 生成摘要 · Google Gemini · 来自 1 个来源。 我们如何撰写摘要 →

JavaScript Promise.all 在单个失败时丢弃成功的结果

本文如何被排名

Signal score
0 / 100
Composite score across the factors below. Higher = stronger signal that this story matters right now.
Newsworthiness bucket
Tool
该条目讨论的是 JavaScript 编程构造的特定行为,而不是新版本发布或重要的行业事件。
Source corroboration
Single-source cluster
Only one publisher covered this so far. Single-source stories can still rank when the publisher is high-authority, but they lack cross-source corroboration.
Topics
other
Editorial topic classification. Feeds into how the story surfaces on /topic/<slug> hub pages and into the per-entity coverage mix.
AI-industry relevance
Low
Off-topic or adjacent — cluster remains reachable but doesn't surface in AI-industry rankings.
Story freshness
1 days old
Coverage has settled into its steady-state source set.

完整方法见我们的编辑标准。

报道来源 [1]

  1. dev.to — Claude Code tag TIER_1 English(EN) · RAXXO Studios ·

    Promise.all 因 1 次调用失败而丢弃了 9 个好结果

    <ul> <li><p>Promise.all on 10 calls with 1 failure returned 0 results, not the 9 that actually succeeded</p></li> <li><p>Promise.all rejected at 19.6ms, abandoning three calls still running at the 300ms mark</p></li> <li><p>Promise.allSettled kept all 9 good results and waited th…