diff options
author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-01-25 08:12:10 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-24 22:12:10 +0100 |
commit | fc176c4dea7463d587a1e921780cce55552e0c86 (patch) | |
tree | 88e996655b20e796571db38896d4db27fcfe54b7 /ext/net/02_tls.js | |
parent | 176118a0468c5b4f2117d18271d814000d4752b2 (diff) |
feat: deprecate `Deno.{Conn,TcpConn,TlsConn,UnixConn}.rid` (#22077)
For removal in Deno v2.
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'ext/net/02_tls.js')
-rw-r--r-- | ext/net/02_tls.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/ext/net/02_tls.js b/ext/net/02_tls.js index e71bd77f5..1411c6d74 100644 --- a/ext/net/02_tls.js +++ b/ext/net/02_tls.js @@ -24,8 +24,24 @@ function opTlsHandshake(rid) { } class TlsConn extends Conn { + #rid = 0; + + constructor(rid, remoteAddr, localAddr) { + super(rid, remoteAddr, localAddr); + this.#rid = rid; + } + + get rid() { + internals.warnOnDeprecatedApi( + "Deno.TlsConn.rid", + new Error().stack, + "Use `Deno.TlsConn` instance methods instead.", + ); + return this.#rid; + } + handshake() { - return opTlsHandshake(this.rid); + return opTlsHandshake(this.#rid); } } |