From 515a34b4de222e35c7ade1b92614d746e73d4c2e Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Thu, 11 Jan 2024 07:37:25 +0900 Subject: refactor: use `core.ensureFastOps()` (#21888) --- ext/io/12_io.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'ext/io') diff --git a/ext/io/12_io.js b/ext/io/12_io.js index 3bf05207d..d9b91a947 100644 --- a/ext/io/12_io.js +++ b/ext/io/12_io.js @@ -5,11 +5,9 @@ // Thank you! We love Go! <3 import { core, primordials } from "ext:core/mod.js"; -const ops = core.ops; -import { - readableStreamForRid, - writableStreamForRid, -} from "ext:deno_web/06_streams.js"; +const { + op_stdin_set_raw, +} = core.ensureFastOps(true); const { Uint8Array, ArrayPrototypePush, @@ -18,6 +16,11 @@ const { TypedArrayPrototypeGetByteLength, } = primordials; +import { + readableStreamForRid, + writableStreamForRid, +} from "ext:deno_web/06_streams.js"; + const DEFAULT_BUFFER_SIZE = 32 * 1024; // Seek whence values. // https://golang.org/pkg/io/#pkg-constants @@ -192,7 +195,7 @@ class Stdin { setRaw(mode, options = {}) { const cbreak = !!(options.cbreak ?? false); - ops.op_stdin_set_raw(mode, cbreak); + op_stdin_set_raw(mode, cbreak); } } -- cgit v1.2.3