[whatwg/streams] Do not leak the closed promise on errored release (#626)

Prior to #619, abort() would reject the closed promise immediately. Now
it waits for queued sink operations to finish. This means that there can
be a window when the stream is errored but the closed promise has not
been rejected. If releaseLock() was called during the window it would
incorrectly create a new closed promise on the assumption it was already
rejected.

Instead, when an abort() is pending, reject the promise rather than
creating a new one.
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/streams/pull/626

-- Commit Summary --

  * Do not leak the closed promise on errored release

-- File Changes --

    M index.bs (3)
    M reference-implementation/lib/writable-stream.js (2)
    M reference-implementation/to-upstream-wpts/writable-streams/aborting.js (59)

-- Patch Links --

https://github.com/whatwg/streams/pull/626.patch
https://github.com/whatwg/streams/pull/626.diff

-- 
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/626

Received on Tuesday, 6 December 2016 04:00:40 UTC