0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

fix: update unstable Deno props for signal API (#12723)

This commit is contained in:
Bartek Iwańczuk 2021-11-10 14:30:20 +01:00 committed by GitHub
parent a632dc5b0d
commit 8ce53dd22b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 19 deletions

View file

@ -36,6 +36,7 @@ const UNSTABLE_DENO_PROPS: &[&str] = &[
"SystemMemoryInfo",
"UnixConnectOptions",
"UnixListenOptions",
"addSignalListener",
"applySourceMap",
"connect",
"consoleSize",
@ -52,11 +53,10 @@ const UNSTABLE_DENO_PROPS: &[&str] = &[
"dlopen",
"osRelease",
"ppid",
"removeSignalListener",
"setRaw",
"shutdown",
"Signal",
"signal",
"signals",
"sleepSync",
"startTls",
"systemMemoryInfo",

View file

@ -1,17 +0,0 @@
Deno.setRaw(0, true);
Deno.setRaw(0, true, { cbreak: true }); // Can be called multiple times
const signal = Deno.signal("SIGINT");
Deno.stdout.writeSync(new TextEncoder().encode("S"));
signal.then(() => {
Deno.stdout.writeSync(new TextEncoder().encode("A"));
signal.dispose();
Deno.setRaw(0, false); // restores old mode.
Deno.setRaw(0, false); // Can be safely called multiple times
});
setTimeout(() => {}, 10000); // Keep the program running