diff options
author | Kenta Moriuchi <moriken@kimamass.com> | 2024-01-11 07:37:25 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-10 15:37:25 -0700 |
commit | 515a34b4de222e35c7ade1b92614d746e73d4c2e (patch) | |
tree | 8284201fc826a33f12597959a8a8be14e0f524bd /ext/io/12_io.js | |
parent | d4893eb51a01c5a692d8ca74a3b8ff95c5fd1d9f (diff) |
refactor: use `core.ensureFastOps()` (#21888)
Diffstat (limited to 'ext/io/12_io.js')
-rw-r--r-- | ext/io/12_io.js | 15 |
1 files changed, 9 insertions, 6 deletions
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); } } |