Skip to content

It's a little confusing that the return type of ReadableStream.pipe() is WritableStream in the IDL #46

@tyoshino

Description

@tyoshino

pipe() chaining is introduced in the spec. The reason why BaseReadableStream.pipe()'s return type is made not void should be to allow for chaining.

But it's a bit confusing that it's WritableStream which doesn't have pipe() method though since it's WritableStream (dest is returned), it should pass any type check and also invocation of pipe() on it should work unless the coder make a mistake (pass non ReadableStream to pipe() and try to chain the result).

If it's intentional, it's nice if there're some clarification comments. Otherwise, fix the return type?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions