diff options
-rw-r--r-- | Cargo.lock | 12 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | ext/fs/30_fs.js | 3 | ||||
-rw-r--r-- | ext/io/12_io.js | 8 | ||||
-rw-r--r-- | ext/node/polyfills/tty.js | 8 | ||||
-rw-r--r-- | runtime/js/40_tty.js | 9 | ||||
-rw-r--r-- | runtime/ops/tty.rs | 13 |
7 files changed, 24 insertions, 31 deletions
diff --git a/Cargo.lock b/Cargo.lock index 50cc8e23a..07f3b8b9a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1257,9 +1257,9 @@ dependencies = [ [[package]] name = "deno_core" -version = "0.267.0" +version = "0.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5dc9aeacf98e78c1d8fa716e35f2e8a960e349f73d6bc485d45e49457d80556" +checksum = "71e476c779b2c95d8b78cf0dcd7d1611800f29d1f762f635519ea0875a366026" dependencies = [ "anyhow", "bincode", @@ -1714,9 +1714,9 @@ dependencies = [ [[package]] name = "deno_ops" -version = "0.143.0" +version = "0.144.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "594aa46152868ee15e104ab3484976a144162694a00c4096174e71b78fdb32c7" +checksum = "3ebaf38d6a37bffed23c5253c94c5bdb33c45872a7476608afc746b21815780d" dependencies = [ "proc-macro-rules", "proc-macro2", @@ -5600,9 +5600,9 @@ dependencies = [ [[package]] name = "serde_v8" -version = "0.176.0" +version = "0.177.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b62c66605745359af254c41af8e6ea2b6124a3698628a7329a6f32698250ee" +checksum = "c875bf0cfb75bf24ad5dd9718420a9a9b30c72e4ec5e54fee8cfe25c96311388" dependencies = [ "bytes", "derive_more", diff --git a/Cargo.toml b/Cargo.toml index b2f6f4fa3..e3eaf97a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ repository = "https://github.com/denoland/deno" [workspace.dependencies] deno_ast = { version = "0.34.1", features = ["transpiling"] } -deno_core = { version = "0.267.0" } +deno_core = { version = "0.268.0" } deno_bench_util = { version = "0.134.0", path = "./bench_util" } deno_lockfile = "0.19.0" diff --git a/ext/fs/30_fs.js b/ext/fs/30_fs.js index 3858bba26..c2fb66528 100644 --- a/ext/fs/30_fs.js +++ b/ext/fs/30_fs.js @@ -72,7 +72,6 @@ import { op_fs_utime_sync, op_fs_write_file_async, op_fs_write_file_sync, - op_is_terminal, op_set_raw, } from "ext:core/ops"; const { @@ -769,7 +768,7 @@ class FsFile { } isTerminal() { - return op_is_terminal(this.#rid); + return core.isTerminal(this.#rid); } setRaw(mode, options = {}) { diff --git a/ext/io/12_io.js b/ext/io/12_io.js index fbaf28de7..f73cb57a6 100644 --- a/ext/io/12_io.js +++ b/ext/io/12_io.js @@ -5,7 +5,7 @@ // Thank you! We love Go! <3 import { core, internals, primordials } from "ext:core/mod.js"; -import { op_is_terminal, op_set_raw } from "ext:core/ops"; +import { op_set_raw } from "ext:core/ops"; const { Uint8Array, ArrayPrototypePush, @@ -222,7 +222,7 @@ class Stdin { } isTerminal() { - return op_is_terminal(this.#rid); + return core.isTerminal(this.#rid); } } @@ -262,7 +262,7 @@ class Stdout { } isTerminal() { - return op_is_terminal(this.#rid); + return core.isTerminal(this.#rid); } } @@ -302,7 +302,7 @@ class Stderr { } isTerminal() { - return op_is_terminal(this.#rid); + return core.isTerminal(this.#rid); } } diff --git a/ext/node/polyfills/tty.js b/ext/node/polyfills/tty.js index b2260a47e..5cbb55ecd 100644 --- a/ext/node/polyfills/tty.js +++ b/ext/node/polyfills/tty.js @@ -1,10 +1,12 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { primordials } from "ext:core/mod.js"; +import { core, primordials } from "ext:core/mod.js"; const { Error, } = primordials; -import { op_is_terminal } from "ext:core/ops"; +const { + isTerminal, +} = core; import { ERR_INVALID_FD } from "ext:deno_node/internal/errors.ts"; import { LibuvStreamWrap } from "ext:deno_node/internal_binding/stream_wrap.ts"; @@ -23,7 +25,7 @@ function isatty(fd) { * correspond to `fd` 0, 1, 2 (stdin, stdout, stderr). This may change in * the future. */ - return op_is_terminal(fd); + return isTerminal(fd); } catch (_) { return false; } diff --git a/runtime/js/40_tty.js b/runtime/js/40_tty.js index dd364f18d..7cf1e4f5d 100644 --- a/runtime/js/40_tty.js +++ b/runtime/js/40_tty.js @@ -1,9 +1,12 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { internals, primordials } from "ext:core/mod.js"; -import { op_console_size, op_is_terminal } from "ext:core/ops"; +import { core, internals, primordials } from "ext:core/mod.js"; +import { op_console_size } from "ext:core/ops"; const { Uint32Array, } = primordials; +const { + isTerminal, +} = core; const size = new Uint32Array(2); @@ -18,7 +21,7 @@ function isatty(rid) { new Error().stack, "Use `Deno.stdin.isTerminal()`, `Deno.stdout.isTerminal()`, `Deno.stderr.isTerminal()` or `Deno.FsFile.isTerminal()` instead.", ); - return op_is_terminal(rid); + return isTerminal(rid); } export { consoleSize, isatty }; diff --git a/runtime/ops/tty.rs b/runtime/ops/tty.rs index e570754f2..3d721734c 100644 --- a/runtime/ops/tty.rs +++ b/runtime/ops/tty.rs @@ -50,12 +50,7 @@ use winapi::um::wincon; deno_core::extension!( deno_tty, - ops = [ - op_set_raw, - op_is_terminal, - op_console_size, - op_read_line_prompt - ], + ops = [op_set_raw, op_console_size, op_read_line_prompt], state = |state| { #[cfg(unix)] state.put(TtyModeStore::default()); @@ -210,12 +205,6 @@ fn op_set_raw( } #[op2(fast)] -fn op_is_terminal(state: &mut OpState, rid: u32) -> Result<bool, AnyError> { - let handle = state.resource_table.get_handle(rid)?; - Ok(handle.is_terminal()) -} - -#[op2(fast)] fn op_console_size( state: &mut OpState, #[buffer] result: &mut [u32], |