Skip to content

fix: order Promise.any() rejection reasons by input index#183

Open
deepview-autofix wants to merge 1 commit into
then:masterfrom
deepview-autofix:deepview/2352ac030b
Open

fix: order Promise.any() rejection reasons by input index#183
deepview-autofix wants to merge 1 commit into
then:masterfrom
deepview-autofix:deepview/2352ac030b

Conversation

@deepview-autofix
Copy link
Copy Markdown

@deepview-autofix deepview-autofix commented Apr 15, 2026

Promise.any() collected rejection reasons using push(), which stored them in completion order rather than input index order. The ES2021 spec requires AggregateError.errors to be ordered by the input promise index. Use index-based assignment and a separate counter instead, matching the approach used by Promise.all().

Fixes: #181

Promise.any() collected rejection reasons using push(), which stored
them in completion order rather than input index order. The ES2021
spec requires AggregateError.errors to be ordered by the input
promise index. Use index-based assignment and a separate counter
instead, matching the approach used by Promise.all().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: DeepView Autofix <276251120+deepview-autofix@users.noreply.github.com>
Co-Authored-By: Nikita Skovoroda <chalkerx@gmail.com>
Signed-off-by: Nikita Skovoroda <chalkerx@gmail.com>
@rollingversions
Copy link
Copy Markdown

There is no change log for this pull request yet.

Create a changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Promise any rejections order is incorrect

1 participant