From b1230586f8d2e35b8cdaafd52e27f0f1e50f245b Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Thu, 25 Jan 2024 09:50:33 +1100 Subject: [PATCH] fix: use `warnOnDeprecatedApi()` in `Deno.TlsListener.rid` (#22089) Missed in #22077 --- ext/net/02_tls.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ext/net/02_tls.js b/ext/net/02_tls.js index 1411c6d74e..5405d68a38 100644 --- a/ext/net/02_tls.js +++ b/ext/net/02_tls.js @@ -75,9 +75,25 @@ async function connectTls({ } class TlsListener extends Listener { + #rid = 0; + + constructor(rid, addr) { + super(rid, addr); + this.#rid = rid; + } + + get rid() { + internals.warnOnDeprecatedApi( + "Deno.TlsListener.rid", + new Error().stack, + "Use `Deno.TlsListener` instance methods instead.", + ); + return this.#rid; + } + async accept() { const { 0: rid, 1: localAddr, 2: remoteAddr } = await op_net_accept_tls( - this.rid, + this.#rid, ); localAddr.transport = "tcp"; remoteAddr.transport = "tcp";