Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistency of return value of ReadableStreamController method call on closed/errored streams #388

Closed
tyoshino opened this issue Aug 5, 2015 · 3 comments
Assignees

Comments

@tyoshino
Copy link
Member

tyoshino commented Aug 5, 2015

It's minor thing, but there's some inconsistency in the reference impl.

Currently:

  • close() on a close()-ed stream: throw a TypeError saying it's already closed
  • close() on an errored-before-close() stream: throw a TypeError saying it's errored
  • enqueue() on an errored stream: throw a TypeError saying it's errored
  • enqueue() on a close()-ed but not errored stream: throw a TypeError saying it's already closed
@domenic
Copy link
Member

domenic commented Aug 5, 2015

I don't actually understand the inconsistency. Is it about the presence or absence of the word "already"?

If it is just changing error message text, feel free to make the change (no PR needed).

@tyoshino
Copy link
Member Author

tyoshino commented Aug 6, 2015

Right, it's only about the ref impl. When one refers to it to know whether the difference of the order matters, they would notice that they have different messages and the two functions have different priorities and may have some question about that.

@tyoshino
Copy link
Member Author

This has been fixed by e601d69

Now, for both ReadableStreamDefaultReader and ReadableStreamBYOBReader, close() and enqueue() has [[closeRequested]] check and [[state]] check in the same order.

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

No branches or pull requests

2 participants