Re: [whatwg/streams] Align WritableStream structure with ReadableStream structure (#462)

> @@ -35,6 +35,18 @@ class WritableStream {
>      return IsWritableStreamLocked(this);
>    }
>  
> +  abort(reason) {
> +    if (IsWritableStream(this) === false) {
> +      throw Promise.reject(new TypeError('WritableStream.prototype.abort can only be used on a WritableStream'));
> +    }
> +
> +    if (IsWritableStreamLocked(this) === true) {
> +      throw Promise.reject(new TypeError('Cannot abort a stream that already has a reader'));

return, not throw. Need tests to catch this.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/462/files/17c3b10dc4243d1d75bb5d07e34397922652a275..cfcb5f4a16dd90e323d9ce97737060a9d03dfa6f#r65446883

Received on Wednesday, 1 June 2016 21:32:54 UTC