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

I'm updating the tests with the "Specify size as a `readonly attribute Function size;`" strategy, and noticing that a lot of them do `things like

```js
  assert_equals(CountQueuingStrategy.prototype.size.call(thisValue, chunk), 1);
```

i.e. they assume you can access `CountQueuingStrategy.prototype.size`. That is not possible, even with this strategy, because the getter will do a thisArg check. You _can_ do

```js
const strategy = new CountQueuingStrategy({ highWaterMark: 0 });
const size = strategy.size; // passes the getter thisArg check

size(5); // no thisArg while calling
size.call(undefined, chunk); // no thisArg while calling
```

but I'm really unsure if this is worth it. I think maybe we should just specify `size()` as a normal Web IDL method.

-- 
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-614312593

Received on Wednesday, 15 April 2020 22:32:24 UTC