From 2d7d6b5ecc19ac6d14bec7a2e479acadd5d5e986 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Tue, 28 Apr 2020 05:36:43 +0200 Subject: [PATCH] Make Deno.kill unstable (#4950) --- cli/js/lib.deno.ns.d.ts | 7 +++++++ cli/ops/process.rs | 1 + 2 files changed, 8 insertions(+) diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts index 8ae71b23f6dfe6..d33fde84494e4d 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -2177,6 +2177,13 @@ declare namespace Deno { * This calls `close()` on stderr after its done. */ stderrOutput(): Promise; close(): void; + + /** **UNSTABLE**: The `signo` argument may change to require the Deno.Signal + * enum. + * + * Send a signal to process. This functionality currently only works on + * Linux and Mac OS. + */ kill(signo: number): void; } diff --git a/cli/ops/process.rs b/cli/ops/process.rs index 0384f5b39d02b7..125aa136b44da4 100644 --- a/cli/ops/process.rs +++ b/cli/ops/process.rs @@ -229,6 +229,7 @@ fn op_kill( args: Value, _zero_copy: Option, ) -> Result { + state.check_unstable("Deno.kill"); state.check_run()?; let args: KillArgs = serde_json::from_value(args)?;