summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/internal_binding/stream_wrap.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ext/node/polyfills/internal_binding/stream_wrap.ts')
-rw-r--r--ext/node/polyfills/internal_binding/stream_wrap.ts13
1 files changed, 8 insertions, 5 deletions
diff --git a/ext/node/polyfills/internal_binding/stream_wrap.ts b/ext/node/polyfills/internal_binding/stream_wrap.ts
index 352bc6a43..87371bf7a 100644
--- a/ext/node/polyfills/internal_binding/stream_wrap.ts
+++ b/ext/node/polyfills/internal_binding/stream_wrap.ts
@@ -30,6 +30,12 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
+import { core } from "ext:core/mod.js";
+const {
+ op_can_write_vectored,
+ op_raw_write_vectored,
+} = core.ensureFastOps();
+
import { TextEncoder } from "ext:deno_web/08_text_encoding.js";
import { Buffer } from "node:buffer";
import { notImplemented } from "ext:deno_node/_utils.ts";
@@ -40,9 +46,6 @@ import {
} from "ext:deno_node/internal_binding/async_wrap.ts";
import { codeMap } from "ext:deno_node/internal_binding/uv.ts";
-import { core } from "ext:core/mod.js";
-const { ops } = core;
-
interface Reader {
read(p: Uint8Array): Promise<number | null>;
}
@@ -204,13 +207,13 @@ export class LibuvStreamWrap extends HandleWrap {
// Fast case optimization: two chunks, and all buffers.
if (
chunks.length === 2 && allBuffers && supportsWritev &&
- ops.op_can_write_vectored(rid)
+ op_can_write_vectored(rid)
) {
// String chunks.
if (typeof chunks[0] === "string") chunks[0] = Buffer.from(chunks[0]);
if (typeof chunks[1] === "string") chunks[1] = Buffer.from(chunks[1]);
- ops.op_raw_write_vectored(
+ op_raw_write_vectored(
rid,
chunks[0],
chunks[1],