Re: [whatwg/streams] [Guideline] Where to factor out logic (#437)

So, my guidelines have been mainly:

- Factor out when used more than once to avoid duplication
- Factor out when it might be called by external specs ("General Readable Stream Abstract Operations" plus ReadableStreamDefaultController{Close,Enqueue,Error,GetDesiredSize}, ReadableStreamDefaultReaderRead, etc.)
  - This covers skipping brand checking, argument validation, argument parsing, and state checking largely; we assume other specs preserve the appropriate invariants and so we don't need to check them and throw errors. That is, only author code is potentially "malicious" in this way.

The "Readable Stream Abstract Operations Used by Controllers" separation also drives things somewhat.

Hope this helps?

---
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/437#issuecomment-210656885

Received on Friday, 15 April 2016 21:36:15 UTC