1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-24 16:19:12 -05:00

fix(ext/node): handle closing process.stdin more than once (#21267)

Fixes https://github.com/denoland/deno/issues/21112

Aligns more towards what Node.js does. Closing stdin more than once is a
nop.
This commit is contained in:
Divy Srivastava 2023-11-20 05:27:18 -08:00 committed by GitHub
parent 611e71cf3b
commit c97a97240b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -365,6 +365,8 @@ Deno.test({
name: "process.stdin readable with a TTY",
// TODO(PolarETech): Run this test even in non tty environment
ignore: !Deno.isatty(Deno.stdin.rid),
// stdin resource is present before the test starts.
sanitizeResources: false,
async fn() {
const promise = deferred();
const expected = ["foo", "bar", null, "end"];

View file

@ -241,7 +241,7 @@ class Stdin {
}
close() {
core.close(this.rid);
core.tryClose(this.rid);
}
get readable() {