content
content copied to clipboard
fix(api): correct ReadableStreamDefaultController.desiredSize value type
Fixes #44486
The Value section claimed desiredSize is "An integer", which is inaccurate on two counts (both raised in the issue):
- It can be
null—ReadableStreamDefaultController.desiredSizereturnsnullwhen the stream has errored (and0when it is closed), per the spec algorithm. - It is not necessarily an integer — the default controller computes
desiredSizefrom the queuing strategy'ssize()results. A custom queuing strategy can return non-integer sizes, sodesiredSizecan be non-integer too.
Updated the description to state the type as "A number, or null" and to explain the negative / non-integer / null / closed cases.