1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00
denoland-deno/tests/specs/run/unref_stdin/main.js
Bartek Iwańczuk 115dedde22
fix: unref stdin read (#23534)
Closes https://github.com/denoland/deno_core/issues/648

Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2024-04-25 05:32:01 +00:00

11 lines
226 B
JavaScript

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();