diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-01-26 23:19:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-26 23:19:00 +0100 |
commit | 6109717c4a4d8139fdbf7165aac3bff2722e16d2 (patch) | |
tree | ed87d3b3daedceb759b5bf376ecd77ae9cc5a35c /ext/net/02_tls.js | |
parent | 942fb5e0388eab02f98c02541a3f90053afd59d1 (diff) |
refactor: make 'rid' properties non-enumerable (#22137)
Now these props will not show up when inspecting objects in console.
Diffstat (limited to 'ext/net/02_tls.js')
-rw-r--r-- | ext/net/02_tls.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ext/net/02_tls.js b/ext/net/02_tls.js index 17d5240fb..f670f0360 100644 --- a/ext/net/02_tls.js +++ b/ext/net/02_tls.js @@ -11,6 +11,7 @@ const { } = core.ensureFastOps(); const { Number, + ObjectDefineProperty, TypeError, } = primordials; @@ -25,12 +26,14 @@ function opTlsHandshake(rid) { } class TlsConn extends Conn { - [internalRidSymbol] = 0; #rid = 0; constructor(rid, remoteAddr, localAddr) { super(rid, remoteAddr, localAddr); - this[internalRidSymbol] = rid; + ObjectDefineProperty(this, internalRidSymbol, { + enumerable: false, + value: rid, + }); this.#rid = rid; } @@ -78,12 +81,14 @@ async function connectTls({ } class TlsListener extends Listener { - [internalRidSymbol] = 0; #rid = 0; constructor(rid, addr) { super(rid, addr); - this[internalRidSymbol] = rid; + ObjectDefineProperty(this, internalRidSymbol, { + enumerable: false, + value: rid, + }); this.#rid = rid; } |