diff options
author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-01-24 13:47:48 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-24 03:47:48 +0100 |
commit | 5a4d69354c3c240a0ea42804b712942f1c30e744 (patch) | |
tree | 1b0e49ca7877887c68892f0061f0245a71323f05 /runtime/js/90_deno_ns.js | |
parent | 4c0b66baab854617993cb242e3be8fe91fb9b0fc (diff) |
feat: deprecate `Deno.shutdown()` (#22067)
For removal in Deno v2.
---------
Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Diffstat (limited to 'runtime/js/90_deno_ns.js')
-rw-r--r-- | runtime/js/90_deno_ns.js | 11 |
1 files changed, 9 insertions, 2 deletions
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, |