chore: upgrade deno_core (#22725)

<!--
Before submitting a PR, please read
https://docs.deno.com/runtime/manual/references/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't
run
   all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench'
label.
-->
This commit is contained in:
Nathan Whitaker 2024-03-06 15:08:10 -08:00 committed by GitHub
parent 6b48aff8fb
commit 9df917c0be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 24 additions and 31 deletions

12
Cargo.lock generated
View file

@ -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",

View file

@ -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"

View file

@ -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 = {}) {

View file

@ -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);
}
}

View file

@ -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;
}

View file

@ -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 };

View file

@ -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());
@ -209,12 +204,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,