From 5a4d69354c3c240a0ea42804b712942f1c30e744 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Wed, 24 Jan 2024 13:47:48 +1100 Subject: feat: deprecate `Deno.shutdown()` (#22067) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For removal in Deno v2. --------- Signed-off-by: Bartek Iwańczuk Co-authored-by: Bartek Iwańczuk --- runtime/js/90_deno_ns.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'runtime') diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js index 25ba2ef26..7ef807140 100644 --- a/runtime/js/90_deno_ns.js +++ b/runtime/js/90_deno_ns.js @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { core } from "ext:core/mod.js"; +import { core, internals } from "ext:core/mod.js"; const { op_net_listen_udp, op_net_listen_unixpacket, @@ -117,7 +117,14 @@ const denoNs = { connectTls: tls.connectTls, listenTls: tls.listenTls, startTls: tls.startTls, - shutdown: net.shutdown, + shutdown(rid) { + internals.warnOnDeprecatedApi( + "Deno.shutdown()", + new Error().stack, + "Use `Deno.Conn.closeWrite()` instead.", + ); + net.shutdown(rid); + }, fstatSync: fs.fstatSync, fstat: fs.fstat, fsyncSync: fs.fsyncSync, -- cgit v1.2.3