diff options
-rw-r--r-- | ext/net/lib.deno_net.d.ts | 3 | ||||
-rw-r--r-- | runtime/js/90_deno_ns.js | 11 |
2 files changed, 12 insertions, 2 deletions
diff --git a/ext/net/lib.deno_net.d.ts b/ext/net/lib.deno_net.d.ts index e3051d6ad..2392c1ff4 100644 --- a/ext/net/lib.deno_net.d.ts +++ b/ext/net/lib.deno_net.d.ts @@ -397,6 +397,9 @@ declare namespace Deno { * Deno.shutdown(conn.rid); * ``` * + * @deprecated Use {@linkcode Deno.Conn.closeWrite} instead. + * {@linkcode Deno.shutdown} will be removed in Deno 2.0. + * * @category Network */ export function shutdown(rid: number): Promise<void>; 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, |