whatwg / streams

Streams Standard
https://streams.spec.whatwg.org/
Other
1.35k stars 160 forks source link

Why is `size` just a function? #1226

Closed j-f1 closed 2 years ago

j-f1 commented 2 years ago

Both ByteLengthQueuingStrategy and CountQueuingStrategy are defined as having a readonly attribute Function size. However, the definition for QueuingStrategy has a specific type for this field: QueuingStrategySize. Is there a reason these two interfaces do not use the more specific type?

domenic commented 2 years ago

This is due to how Web IDL works. The type of attributes don't really matter, and it's easier to create a Function in spec text. Whereas the types of dictionary members have normative impacts on how inputs are processed and called.

Hope this helps!