- From: Takeshi Yoshino <notifications@github.com>
- Date: Wed, 05 Apr 2017 04:08:31 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/streams/pull/721/review/31018386@github.com>
tyoshino commented on this pull request. > - WritableStreamRejectAbortRequestIfPending(stream); - WritableStreamRejectPromisesInReactionToError(stream); +function WritableStreamFinishError(stream) { + assert(stream._state === 'erroring', 'stream._state === erroring'); + assert(WritableStreamHasOperationMarkedInFlight(stream) === false, + 'WritableStreamHasOperationMarkedInFlight(stream) === false'); + stream._state = 'errored'; + stream._writableStreamController[ErrorSteps](); + + const storedError = stream._storedError; + for (const writeRequest of stream._writeRequests) { + writeRequest._reject(storedError); + } + stream._writeRequests = []; + + if (stream._pendingAbortRequest === undefined) { Could you please update `'controller.error(), writer.abort() while there is an in-flight write, and then finish the write'` test to check that `sink.abort()` is not called for this (error() then abort()) sequence? controller.error() calls WritableStreamErroring() to change the state to erroring. WritableStreamAbort() skips WritableStreamErroring() when the state is erroring, but it does set _pendingAbortRequest. It should be rejected (right?) when controller.error() happened before writer.abort(), but it looks it would get processed by the code below. -- 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/721#pullrequestreview-31018386
Received on Wednesday, 5 April 2017 11:09:04 UTC