Skip to content

ReadableStream.from({}) returns confusing error #53819

@rotu

Description

@rotu

Version

v22.4.1

Platform

Darwin Hypothesis.local 24.0.0 Darwin Kernel Version 24.0.0: Mon Jul  1 21:58:28 PDT 2024; root:xnu-11215.0.132.501.1~1/RELEASE_ARM64_T8103 arm64

Subsystem

No response

What steps will reproduce the bug?

ReadableStream.from({})

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior? Why is that the expected behavior?

It should show a more descriptive error message. Maybe "value is not iterable".

What do you see instead?

> ReadableStream.from({})
Uncaught TypeError: FunctionPrototypeCall is not a function
    at getIterator (node:internal/webstreams/util:246:20)
    at getIterator (node:internal/webstreams/util:238:36)
    at readableStreamFromIterable (node:internal/webstreams/readablestream:1315:26)
    at ReadableStream.from (node:internal/webstreams/readablestream:311:12)

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions