Skip to content

Commit 5d1e25f

Browse files
authored
Fix Deno compatibility issues on Windows (rescript-lang#6850)
Signed-off-by: Alex Kocharin <alex@kocharin.ru>
1 parent f2e240b commit 5d1e25f

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
@@ -61,10 +61,15 @@ process.on("uncaughtException", onUncaughtException);
6161
// Ctrl+C
6262
process.on("SIGINT", exitProcess);
6363
// kill pid
64-
process.on("SIGUSR1", exitProcess);
65-
process.on("SIGUSR2", exitProcess);
66-
process.on("SIGTERM", exitProcess);
67-
process.on("SIGHUP", exitProcess);
64+
try {
65+
process.on("SIGUSR1", exitProcess);
66+
process.on("SIGUSR2", exitProcess);
67+
process.on("SIGTERM", exitProcess);
68+
process.on("SIGHUP", exitProcess);
69+
} catch (_e) {
70+
// Deno might throw an error here, see https://github.com/denoland/deno/issues/9995
71+
// TypeError: Windows only supports ctrl-c (SIGINT) and ctrl-break (SIGBREAK).
72+
}
6873

6974
const args = process.argv.slice(2);
7075
const argPatterns = {

0 commit comments

Comments
 (0)