- From: Domenic Denicola <notifications@github.com>
- Date: Tue, 15 Nov 2016 19:51:22 -0800
- To: whatwg/streams <streams@noreply.github.com>
- Message-ID: <whatwg/streams/pull/613/c260846825@github.com>
I'm not opposed to this if these tests are helpful for implementers, such as yourself. However, I've been resistant in the past because where do we stop? For example, this is robust against passing in an `{ apply() { } }` object. But it's not robust against overriding `Function.prototype.apply`. Should we be guarding against that? Similarly, we operate on promises a lot by using the built-in `Promise.resolve` and friends, which is not robust against overrides. In general this kind of comes down to what the role of tests and the reference implementation are. I'm of the opinion the reference implementation is not meant to be perfect in every way; otherwise it would become much less easy to read and develop. Instead it's meant to provide something useful we can write tests against. Similarly, the goals of tests is not to necessarily hit every possible way something could be implemented wrong; they kind of assume a base level of things being done correctly, in many cases, and focus on testing the important logic. But, again, any philosophical considerations here are entirely overridden by what works best for implementers. If these sorts of tests are useful, then we should include them. And that means updating the reference implementation to pass them. So if this is useful to you, I'm happy to see this merged in. -- 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/613#issuecomment-260846825
Received on Wednesday, 16 November 2016 03:51:56 UTC