Skip to content

Lower Array.fromAsync over arrays - #1176

Merged
ctate merged 1 commit into
mainfrom
ctate/lower-array-fromasync-1c1533
Oct 17, 2026
Merged

ctate merged 1 commit into
mainfrom
ctate/lower-array-fromasync-1c1533

Conversation

@ctate

@ctate ctate commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator
  • Array.fromAsync(array, mapFn?) compiles for arrays of values or promises, with Node's microtask order for results, rejections and iterator closes.
  • Async generator sources are refused until async generator completion settles on Node's turn.

The ESNext array lib is now part of the type world, and Array.fromAsync(source,
mapFn?) compiles when the source is an array of values or of promises. Each
call lowers to an async helper with the spec's loop: elements are awaited
through the async-from-sync iterator, with the same microtask turns as a
`for await` loop over an array, and a mapping function's result is awaited
before it is stored. A throwing or rejecting mapping function and a rejected
element close the iterator before the returned promise rejects, on the turn
Node rejects it. Async generator sources, a thisArg, and arrays that mix
values and promises are refused.
@vercel

vercel Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
scriptc Ready Ready Preview, v0 Oct 17, 2026 6:48am UTC

@ctate
ctate merged commit eca55f5 into main Oct 17, 2026
66 checks passed
@ctate
ctate deleted the ctate/lower-array-fromasync-1c1533 branch October 17, 2026 07:09

This branch was successfully deployed

1 active deployment
Preview — f7ad1f96 Deployed Oct 17, 2026 by vercel[bot]
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.

1 participant