[whatwg/streams] Calling close() on TransformStreamDefaultController should relieve backpressure (#774)

I think the following test should pass:

```javascript
promise_test(t => {
  const ts = recordingIdentityTransformStream();
  const rs = new ReadableStream({
    start(controller) {
      controller.enqueue(0);
      controller.enqueue(1);
      controller.enqueue(2);
      controller.close();
    }
  });
  const pipeToPromise = rs.pipeTo(ts.writable);
  return delay(0).then(() => {
    assert_array_equals(ts.events, ['transform', 0], 'transform() should have seen one chunk');
    ts.controller.close();
    return promise_rejects(t, new TypeError(), pipeToPromise, 'enqueuing the second chunk should fail');
  }).then(() => {
    assert_array_equals(ts.events, ['transform', 0, 'transform', 1], 'transform() should have seen two chunks');
  });
}, 'closing readable should permit remaining chunks to be processed');
```

Currently `pipeToPromise` never becomes settled because the second chunk is never written.

I think this should work. Having a method which blocks the pipe permanently if you call it when there is backpressure doesn't seem very useful to me.

-- 
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/issues/774

Received on Tuesday, 22 August 2017 15:13:56 UTC