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

fix(cli): use rid getter for stdio #8014

Merged

Conversation

caspervonb
Copy link
Contributor

This changes the rid of Deno.stdin, Deno.stdout, Deno.stderr from a mutable property into a getter to match the rid semantics of Deno.File.

This changes the rid of Deno.stdin, Deno.stdout, Deno.stderr from a
mutable property into a getter to match the rid semantics of Deno.File.
Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the typings to reflect this?

Comment on lines +713 to +717
export const stdin: Reader & ReaderSync & Closer & { readonly rid: number };
/** A handle for `stdout`. */
export const stdout: Writer & WriterSync & Closer & { rid: number };
export const stdout: Writer & WriterSync & Closer & { readonly rid: number };
/** A handle for `stderr`. */
export const stderr: Writer & WriterSync & Closer & { rid: number };
export const stderr: Writer & WriterSync & Closer & { readonly rid: number };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is breaking change 😬

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, yes but I don't think we ever intended for them to actually be mutable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@caspervonb that's true, I'm only afraid it's gonna cause type checking havoc, hopefully not many users access rid of stdio objects.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Access should be fine - it should only break if someone tries to update it.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

3 participants