[whatwg/streams] Marking promise rejections as handled (#547)

See https://bugs.chromium.org/p/chromium/issues/detail?id=654701 for background /cc @yutakahirano @jakearchibald. Also https://github.com/whatwg/streams/issues/468 is kind of related, but that issue was about pipeTo which was confusing since pipeTo was under flux at the time.

A simple repro ([run in Chrome](http://jsbin.com/sopogoyoyi/edit?html,output)) is

```js
window.onunhandledrejection = e => {
  console.log(e.reason);
};

const rs = new ReadableStream({
  start(controller) {
    controller.close();
  }
});
const reader = rs.getReader();
reader.releaseLock();
```

This will log an unhandled rejection (and also show up in the console in Chrome, but that's a browser-specific devtools thing).

I think the correct solution is that all "state promises" like `.closed` should be marked as having their rejection handled (i.e. their [[PromiseIsHandled]] slot should be set to true).

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

Received on Wednesday, 19 October 2016 15:52:56 UTC