Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct optionality of ReadableStreamReadDoneResult.value #1914

Merged

Conversation

Renegade334
Copy link
Contributor

@Renegade334 Renegade334 commented Feb 20, 2025

The streams protocol specifies for ReadableStreamReadResult that the value property is always present. If the stream is cancelled, then this property won't be absent, but will be present with the value undefined. (This differs from eg. the iterator protocol, where a result object's value property may indeed be absent if the iterator is closed.)

The difference is only really manifest when exactOptionalPropertyTypes is enabled, but where it is, ReadableStreamReadDoneResult is currently divergent from the web standard.

Copy link
Contributor

Thanks for the PR!

This section of the codebase is owned by @saschanaz - if they write a comment saying "LGTM" then it will be merged.

@Renegade334 Renegade334 changed the title Correct optionality of ReadableStreamReadValueResult.value Correct optionality of ReadableStreamReadDoneResult.value Feb 20, 2025
@saschanaz
Copy link
Contributor

saschanaz commented Feb 20, 2025

Technically it's optional per the IDL , but the behavior always assigns value there. So LGTM.

@github-actions github-actions bot merged commit 965dd63 into microsoft:main Feb 20, 2025
6 checks passed
Copy link
Contributor

Merging because @saschanaz is a code-owner of all the changes - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants