Re: [whatwg/streams] Specifying QueuingStrategies in WebIDL (#1005)

Would this mean that `CountQueuingStrategy.prototype.size()` must always be called with a proper `CountQueuingStrategy` object as `this` context? Correct me if I'm wrong, but it seems like [the WebIDL spec requires a brand check on all operations](https://heycam.github.io/webidl/#dfn-create-operation-function):
> 2. If target is an interface, and op is not a static operation:
> 2.1. Let esValue be the this value, if it is not null or undefined, or realm’s global object otherwise. (This will subsequently cause a TypeError in a few steps, if the global object does not implement target and [LenientThis] is not specified.)
> 2.2. If esValue is a platform object, then perform a security check, passing esValue, id, and "method".
> 2.3. **If esValue does not implement the interface target, throw a TypeError.**

This would be a problem in the current streams specification, since we always call the size algorithm as a plain function with no `this` context.

-- 
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/1005#issuecomment-509717329

Received on Tuesday, 9 July 2019 16:40:52 UTC