[whatwg/streams] "it can return a promise" -> actually a thenable (#566)

https://streams.spec.whatwg.org/#ref-for-pull-source-1

> it can return a promise

Actually a thenable. The same applies to all sink and source methods that can return a Promise.

I noticed this when I was looking at the Closure compiler extern definitions for Streams, at https://github.com/google/closure-compiler/blob/master/externs/browser/streamsapi.js

For example, the type of `ReadableStreamSource.prototype.start` is declared as `function((!ReadableByteStreamController|!ReadableStreamDefaultController)):(!Promise<*>|undefined))`. At first I thought this was a bug in Closure's extern definitions, but then I realised that this is what the Streams standard actually says.

Editorially, the simplest fix would be to say "thenable" where we currently say "Promise", but I am concerned that might be too hard to understand.

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

Received on Wednesday, 26 October 2016 08:06:28 UTC