diff options
Diffstat (limited to 'ext/net')
-rw-r--r-- | ext/net/01_net.js | 18 | ||||
-rw-r--r-- | ext/net/02_tls.js | 12 |
2 files changed, 15 insertions, 15 deletions
diff --git a/ext/net/01_net.js b/ext/net/01_net.js index f761aed14..8dbf32625 100644 --- a/ext/net/01_net.js +++ b/ext/net/01_net.js @@ -4,6 +4,7 @@ import { core, internals, primordials } from "ext:core/mod.js"; const { BadResourcePrototype, InterruptedPrototype, + internalRidSymbol, } = core; const { op_dns_resolve, @@ -40,7 +41,6 @@ const { SetPrototypeForEach, SymbolAsyncIterator, Symbol, - SymbolFor, TypeError, TypedArrayPrototypeSubarray, Uint8Array, @@ -91,7 +91,7 @@ async function resolveDns(query, recordType, options) { } class Conn { - [SymbolFor("Deno.internal.rid")] = 0; + [internalRidSymbol] = 0; #rid = 0; #remoteAddr = null; #localAddr = null; @@ -102,7 +102,7 @@ class Conn { #writable; constructor(rid, remoteAddr, localAddr) { - this[SymbolFor("Deno.internal.rid")] = rid; + this[internalRidSymbol] = rid; this.#rid = rid; this.#remoteAddr = remoteAddr; this.#localAddr = localAddr; @@ -201,12 +201,12 @@ class Conn { } class TcpConn extends Conn { - [SymbolFor("Deno.internal.rid")] = 0; + [internalRidSymbol] = 0; #rid = 0; constructor(rid, remoteAddr, localAddr) { super(rid, remoteAddr, localAddr); - this[SymbolFor("Deno.internal.rid")] = rid; + this[internalRidSymbol] = rid; this.#rid = rid; } @@ -229,12 +229,12 @@ class TcpConn extends Conn { } class UnixConn extends Conn { - [SymbolFor("Deno.internal.rid")] = 0; + [internalRidSymbol] = 0; #rid = 0; constructor(rid, remoteAddr, localAddr) { super(rid, remoteAddr, localAddr); - this[SymbolFor("Deno.internal.rid")] = rid; + this[internalRidSymbol] = rid; this.#rid = rid; } @@ -249,14 +249,14 @@ class UnixConn extends Conn { } class Listener { - [SymbolFor("Deno.internal.rid")] = 0; + [internalRidSymbol] = 0; #rid = 0; #addr = null; #unref = false; #promise = null; constructor(rid, addr) { - this[SymbolFor("Deno.internal.rid")] = rid; + this[internalRidSymbol] = rid; this.#rid = rid; this.#addr = addr; } diff --git a/ext/net/02_tls.js b/ext/net/02_tls.js index 021ad9371..17d5240fb 100644 --- a/ext/net/02_tls.js +++ b/ext/net/02_tls.js @@ -1,6 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { core, internals, primordials } from "ext:core/mod.js"; +const { internalRidSymbol } = core; const { op_net_accept_tls, op_net_connect_tls, @@ -10,7 +11,6 @@ const { } = core.ensureFastOps(); const { Number, - SymbolFor, TypeError, } = primordials; @@ -25,12 +25,12 @@ function opTlsHandshake(rid) { } class TlsConn extends Conn { - [SymbolFor("Deno.internal.rid")] = 0; + [internalRidSymbol] = 0; #rid = 0; constructor(rid, remoteAddr, localAddr) { super(rid, remoteAddr, localAddr); - this[SymbolFor("Deno.internal.rid")] = rid; + this[internalRidSymbol] = rid; this.#rid = rid; } @@ -78,12 +78,12 @@ async function connectTls({ } class TlsListener extends Listener { - [SymbolFor("Deno.internal.rid")] = 0; + [internalRidSymbol] = 0; #rid = 0; constructor(rid, addr) { super(rid, addr); - this[SymbolFor("Deno.internal.rid")] = rid; + this[internalRidSymbol] = rid; this.#rid = rid; } @@ -151,7 +151,7 @@ async function startTls( } = {}, ) { const { 0: rid, 1: localAddr, 2: remoteAddr } = await opStartTls({ - rid: conn[SymbolFor("Deno.internal.rid")], + rid: conn[internalRidSymbol], hostname, certFile, caCerts, |