diff options
author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-01-25 04:52:55 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-24 18:52:55 +0100 |
commit | abaffad028ab1d7fb71f7d4cc5ade94f99d0b11e (patch) | |
tree | 69854489f50163afd426ff7b87558ad6e8106143 /ext/net/01_net.js | |
parent | f5097d9d3b62f7dc8e29e85e12f6a6f2858addbf (diff) |
feat: deprecate `Deno.Listener.rid` (#22076)
For removal in Deno v2.
Diffstat (limited to 'ext/net/01_net.js')
-rw-r--r-- | ext/net/01_net.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ext/net/01_net.js b/ext/net/01_net.js index ffae6c56f..73d8bad49 100644 --- a/ext/net/01_net.js +++ b/ext/net/01_net.js @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { core, primordials } from "ext:core/mod.js"; +import { core, internals, primordials } from "ext:core/mod.js"; const { BadResourcePrototype, InterruptedPrototype, @@ -216,6 +216,11 @@ class Listener { } get rid() { + internals.warnOnDeprecatedApi( + "Deno.Listener.rid", + new Error().stack, + "Use `Deno.Listener` instance methods instead.", + ); return this.#rid; } @@ -227,10 +232,10 @@ class Listener { let promise; switch (this.addr.transport) { case "tcp": - promise = op_net_accept_tcp(this.rid); + promise = op_net_accept_tcp(this.#rid); break; case "unix": - promise = op_net_accept_unix(this.rid); + promise = op_net_accept_unix(this.#rid); break; default: throw new Error(`Unsupported transport: ${this.addr.transport}`); @@ -276,7 +281,7 @@ class Listener { } close() { - core.close(this.rid); + core.close(this.#rid); } [SymbolDispose]() { |