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

>      }
> -    if (this._state === 'closed') {
> -      return Promise.reject(new TypeError('cannot close an already-closed stream'));
> +
> +    stream._state = 'waiting';
> +
> +    if (writer !== undefined) {
> +      WritableStreamDefaultWriterReadyPromiseReset(writer);

I think this is a helper function, but in the spec language we would not write it as an abstract op. Because in the spec language we don't need to track the resolve and reject callbacks, so it can be a very simple "Set writer.[[readyPromise]] to a new promise." The same might be true of many of the other promise-manipulation methods.

In general naming them with lowerCamelCase and maybe moving them to another block would help differentiate when it comes time to do the spec transition.

---
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/488/files/dfa07172203b4c292cfb5a3fc88e821a1db7c3db#r72938441

Received on Monday, 1 August 2016 08:19:17 UTC