Skip to content

Commit bbada2d

Browse files
rlidwkacknitt
authored andcommitted
Fix Deno compatibility issues on Windows (#6850)
Signed-off-by: Alex Kocharin <alex@kocharin.ru>
1 parent 93e16f6 commit bbada2d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

rescript

+9-4
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,15 @@ process.on("uncaughtException", onUncaughtException);
6262
// Ctrl+C
6363
process.on("SIGINT", exitProcess);
6464
// kill pid
65-
process.on("SIGUSR1", exitProcess);
66-
process.on("SIGUSR2", exitProcess);
67-
process.on("SIGTERM", exitProcess);
68-
process.on("SIGHUP", exitProcess);
65+
try {
66+
process.on("SIGUSR1", exitProcess);
67+
process.on("SIGUSR2", exitProcess);
68+
process.on("SIGTERM", exitProcess);
69+
process.on("SIGHUP", exitProcess);
70+
} catch (_e) {
71+
// Deno might throw an error here, see https://github.com/denoland/deno/issues/9995
72+
// TypeError: Windows only supports ctrl-c (SIGINT) and ctrl-break (SIGBREAK).
73+
}
6974

7075
const process_argv = process.argv;
7176
const maybeSubcommand = process_argv[2];

0 commit comments

Comments
 (0)