mirror of
https://github.com/denoland/deno.git
synced 2024-12-25 16:49:18 -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:
parent
611e71cf3b
commit
c97a97240b
2 changed files with 3 additions and 1 deletions
|
@ -365,6 +365,8 @@ Deno.test({
|
||||||
name: "process.stdin readable with a TTY",
|
name: "process.stdin readable with a TTY",
|
||||||
// TODO(PolarETech): Run this test even in non tty environment
|
// TODO(PolarETech): Run this test even in non tty environment
|
||||||
ignore: !Deno.isatty(Deno.stdin.rid),
|
ignore: !Deno.isatty(Deno.stdin.rid),
|
||||||
|
// stdin resource is present before the test starts.
|
||||||
|
sanitizeResources: false,
|
||||||
async fn() {
|
async fn() {
|
||||||
const promise = deferred();
|
const promise = deferred();
|
||||||
const expected = ["foo", "bar", null, "end"];
|
const expected = ["foo", "bar", null, "end"];
|
||||||
|
|
|
@ -241,7 +241,7 @@ class Stdin {
|
||||||
}
|
}
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
core.close(this.rid);
|
core.tryClose(this.rid);
|
||||||
}
|
}
|
||||||
|
|
||||||
get readable() {
|
get readable() {
|
||||||
|
|
Loading…
Reference in a new issue