From 386821ff2145e24bf3f6e74f8c15e196a6460778 Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Thu, 4 Jul 2024 00:36:04 +0400 Subject: [PATCH] Fix Deno compatibility issues on Windows Signed-off-by: Alex Kocharin --- rescript | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/rescript b/rescript index bfd4c93a58..94ac87c137 100755 --- a/rescript +++ b/rescript @@ -61,10 +61,15 @@ process.on("uncaughtException", onUncaughtException); // Ctrl+C process.on("SIGINT", exitProcess); // kill pid -process.on("SIGUSR1", exitProcess); -process.on("SIGUSR2", exitProcess); -process.on("SIGTERM", exitProcess); -process.on("SIGHUP", exitProcess); +try { + process.on("SIGUSR1", exitProcess); + process.on("SIGUSR2", exitProcess); + process.on("SIGTERM", exitProcess); + process.on("SIGHUP", exitProcess); +} catch (_e) { + // Deno might throw an error here, see https://github.com/denoland/deno/issues/9995 + // TypeError: Windows only supports ctrl-c (SIGINT) and ctrl-break (SIGBREAK). +} const args = process.argv.slice(2); const argPatterns = {