Skip to content

Streams: use Web IDL async_sequence in ReadableStream.from #64288

Description

@MattiasBuelens

We are updating the Streams specification to use Web IDL's async_sequence<T> type for the input of ReadableStream.from(). The new IDL is:

interface ReadableStream {
  static ReadableStream from(async_sequence<any> asyncIterable);
}

This comes with one behavioral change: ReadableStream.from("abc") used to iterate over the Unicode code points of the string (per String.prototype[Symbol.iterator]), but this will now throw a TypeError instead. The WPT tests have been updated to reflect this.

Specification change: whatwg/streams#1372
Tests: web-platform-tests/wpt#59594

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    web streamsIssues and PRs related to the Web Streams API.web-standardsIssues and PRs related to web-platform APIs and standards compliance.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions