summaryrefslogtreecommitdiff
path: root/tests/specs/run/unref_stdin/main.js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-04-25 06:32:01 +0100
committerGitHub <noreply@github.com>2024-04-25 05:32:01 +0000
commit115dedde22edc60707826c4073e0ee90431b86f1 (patch)
treeb23b5290ab535419b43f564099e4b519b1b72cab /tests/specs/run/unref_stdin/main.js
parent1de162f1c1ef0ea9a2b653bc29cd0e3e00386abd (diff)
fix: unref stdin read (#23534)
Closes https://github.com/denoland/deno_core/issues/648 Co-authored-by: Matt Mastracci <matthew@mastracci.com>
Diffstat (limited to 'tests/specs/run/unref_stdin/main.js')
-rw-r--r--tests/specs/run/unref_stdin/main.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/specs/run/unref_stdin/main.js b/tests/specs/run/unref_stdin/main.js
new file mode 100644
index 000000000..db722bd13
--- /dev/null
+++ b/tests/specs/run/unref_stdin/main.js
@@ -0,0 +1,11 @@
+const { core } = Deno[Deno.internal];
+const opPromise = core.read(Deno.stdin.rid, new Uint8Array(10));
+core.unrefOpPromise(opPromise);
+
+async function main() {
+ console.log(1);
+ await opPromise;
+ console.log(2);
+}
+
+main();