From d1a9c4cd7ce0c19ddf9c7c52c0d35d6124a7677d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 27 Mar 2023 02:15:08 +0200 Subject: refactor: remove Deno[Deno.internal].nodeUnstable namespace (#18449) Since we can preserve ops in the snapshot these days, we no longer need to have "Deno[Deno.internal].nodeUnstable" namespace. Instead, various built-in Node.js modules can use appropriate APIs directly. --- ext/node/polyfills/internal_binding/udp_wrap.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ext/node/polyfills/internal_binding') diff --git a/ext/node/polyfills/internal_binding/udp_wrap.ts b/ext/node/polyfills/internal_binding/udp_wrap.ts index b36334a54..2b25ccb42 100644 --- a/ext/node/polyfills/internal_binding/udp_wrap.ts +++ b/ext/node/polyfills/internal_binding/udp_wrap.ts @@ -20,6 +20,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. +const core = globalThis.Deno.core; +const ops = core.ops; import { AsyncWrap, providerType, @@ -32,12 +34,13 @@ import { notImplemented } from "ext:deno_node/_utils.ts"; import { Buffer } from "ext:deno_node/buffer.ts"; import type { ErrnoException } from "ext:deno_node/internal/errors.ts"; import { isIP } from "ext:deno_node/internal/net.ts"; - +import * as net from "ext:deno_net/01_net.js"; import { isLinux, isWindows } from "ext:deno_node/_util/os.ts"; -// @ts-ignore Deno[Deno.internal] is used on purpose here -const DenoListenDatagram = Deno[Deno.internal]?.nodeUnstable?.listenDatagram || - Deno.listenDatagram; +const DenoListenDatagram = net.createListenDatagram( + ops.op_node_unstable_net_listen_udp, + ops.op_node_unstable_net_listen_unixpacket, +); type MessageType = string | Uint8Array | Buffer | DataView; -- cgit v1.2.3