summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/internal_binding/udp_wrap.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-03-28 14:44:22 +0200
committerGitHub <noreply@github.com>2023-03-28 14:44:22 +0200
commite5b2815b3943cd39038bba00da462082c6988e6e (patch)
tree54953513a9c2947dcb2611f079512d07a0f5a0c9 /ext/node/polyfills/internal_binding/udp_wrap.ts
parent10012c2fe312a4f7ddc5217adaa6718c91bfb819 (diff)
Reland "refactor: remove Deno[Deno.internal].nodeUnstable namespace" (#18475)
This reverts commit 357bcfcf79fee92195e37bb3f05e247908f207c5.
Diffstat (limited to 'ext/node/polyfills/internal_binding/udp_wrap.ts')
-rw-r--r--ext/node/polyfills/internal_binding/udp_wrap.ts11
1 files changed, 7 insertions, 4 deletions
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;