From d85ccce65bbaf0be6b55459847326f440d8676a1 Mon Sep 17 00:00:00 2001 From: Casper Beyer Date: Tue, 7 Sep 2021 23:34:46 +0800 Subject: fix(runtime): return error instead of panicking for windows signals (#11940) --- runtime/ops/signal.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/ops/signal.rs b/runtime/ops/signal.rs index 40309657d..84beaf3c8 100644 --- a/runtime/ops/signal.rs +++ b/runtime/ops/signal.rs @@ -1,4 +1,6 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +#[cfg(not(unix))] +use deno_core::error::generic_error; use deno_core::error::type_error; use deno_core::error::AnyError; use deno_core::op_async_unref; @@ -194,7 +196,7 @@ pub fn op_signal_bind( _args: (), _: (), ) -> Result<(), AnyError> { - unimplemented!(); + Err(generic_error("not implemented")) } #[cfg(not(unix))] @@ -203,7 +205,7 @@ fn op_signal_unbind( _args: (), _: (), ) -> Result<(), AnyError> { - unimplemented!(); + Err(generic_error("not implemented")) } #[cfg(not(unix))] @@ -212,5 +214,5 @@ async fn op_signal_poll( _args: (), _: (), ) -> Result<(), AnyError> { - unimplemented!(); + Err(generic_error("not implemented")) } -- cgit v1.2.3