Uh oh!
There was an error while loading. Please reload this page.
stream: reject strings in ReadableStream.from - #64465
Conversation
Use Web IDL async_sequence semantics for ReadableStream.from(), which require the input to be an object. This causes primitive strings to throw a TypeError instead of being iterated by code point. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.6-sol
nodejs-github-bot
commented
Jul 13, 2026
Review requested:
|
jasnell
commented
Jul 13, 2026
I'd rather go a different way with this... while it is not strictly spec compliant, |
MattiasBuelens
commented
Jul 13, 2026
Tests have been merged in web-platform-tests/wpt@99d74f9, so you can do a proper
@jasnell Sure, we can discuss. For reference, the original decision for throwing on |
jasnell
commented
Jul 13, 2026
Discussion thread: whatwg/streams#1376 |
mcollina
commented
Jul 13, 2026
Marked cautionarily as semver-major. I might be convinced we should land this in v26.x, but definitely not in 24 and 22. |
MattiasBuelens
commented
Aug 31, 2026
whatwg/streams#1372 has landed, so this can move out of draft. Unless we first want further discussion on whatwg/streams#1376? |
Refs: #64288
Depends on: web-platform-tests/wpt#59594
Use Web IDL
async_sequence<any>semantics forReadableStream.from().This changes
ReadableStream.from('abc')to throw aTypeErrorinsteadof iterating over the string's Unicode code points. Web IDL async
sequences require the input value to be an ECMAScript object.
The corresponding WPT change is included provisionally. This PR should
not land until the upstream WPT PR is merged. Afterward, the Streams WPT
fixtures will be regenerated with
git node wpt streams.Assisted-by: openai:gpt-5.6-sol