Skip to content

fix(ext/webidl): implement async_sequence for ReadableStream.from - #35976

Merged
bartlomieju merged 9 commits into
denoland:mainfrom
petamoriken:fix/async-sequence
Jul 22, 2026
Merged

fix(ext/webidl): implement async_sequence for ReadableStream.from#35976
bartlomieju merged 9 commits into
denoland:mainfrom
petamoriken:fix/async-sequence

Conversation

@petamoriken

@petamoriken petamoriken commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Closes #35777
Closes #35611
Closes #30020

Generated with assistance from Grok Build

@crowlKats
crowlKats self-requested a review July 11, 2026 17:13
"from.any.html": {
"expectedFailures": [
"ReadableStream.from ignores a null @@asyncIterator",
"ReadableStream.from accepts a string"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WPT for ReadableStream.from accepting a string will be updated to throw a TypeError in web-platform-tests/wpt#59594

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you bump the WPT submodule so this test is included?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated!

Replace the ad-hoc async iterable converter with Web IDL async_sequence
conversion (GetMethod, Object-only, CreateAsyncFromSyncIterator) and wire
ReadableStream.from to async_sequence<any>, per whatwg/streams#1372.

Closes denoland#35777
Comment thread ext/webidl/internal.d.ts
Comment on lines -465 to +466
interface ConvertedAsyncIterable<V, T> extends AsyncIterableIterator<T> {
interface ConvertedAsyncSequence<V, T> extends AsyncIterable<T> {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits: ConvertedAsyncSequence is an Iterable but not an Iterator, as it does not have a next method

Comment on lines -118 to +123
"from.any.html": {
"expectedFailures": [
"ReadableStream.from ignores a null @@asyncIterator",
"ReadableStream.from accepts a string"
]
},
"from.any.worker.html": {
"expectedFailures": [
"ReadableStream.from ignores a null @@asyncIterator",
"ReadableStream.from accepts a string"
]
},
"from.any.html": true,
"from.any.worker.html": true,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test passed 😄

@bartlomieju bartlomieju left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work, thank you

@bartlomieju
bartlomieju merged commit 10979e6 into denoland:main Jul 22, 2026
135 checks passed
@petamoriken
petamoriken deleted the fix/async-sequence branch July 22, 2026 13:24
bartlomieju pushed a commit that referenced this pull request Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants