summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartek Iwańczuk <biwanczuk@gmail.com>2024-02-07 02:16:08 +0100
committerGitHub <noreply@github.com>2024-02-07 02:16:08 +0100
commit043fee48fd72fbce2357e93431753db5b086cffd (patch)
tree49d254335953cc03e346d0fe7267eae5260652b8
parente54684864dee1c708325570eaaff2fce0f928387 (diff)
chore: upgrade deno_core to 0.259.0 (#22311)
This update brings number of ops available to user code down to 45.
-rw-r--r--Cargo.lock12
-rw-r--r--Cargo.toml2
-rw-r--r--cli/js/40_test.js4
-rw-r--r--cli/tests/unit/ops_test.ts2
-rw-r--r--cli/tests/unit/text_encoding_test.ts28
-rw-r--r--cli/tools/test/mod.rs2
-rw-r--r--ext/fs/30_fs.js8
-rw-r--r--ext/net/01_net.js4
-rw-r--r--ext/web/lib.rs16
-rw-r--r--runtime/js/99_main.js6
10 files changed, 19 insertions, 65 deletions
diff --git a/Cargo.lock b/Cargo.lock
index ebf28430e..345323b58 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1196,9 +1196,9 @@ dependencies = [
[[package]]
name = "deno_core"
-version = "0.258.0"
+version = "0.259.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f200cdc161745281e4ec56e3b0e563058d2cc50a824ac901823ed0720b481619"
+checksum = "f62dc88f7f56fa48906e37fbea089128da7405e09b0f99bcd488f4f13f20c491"
dependencies = [
"anyhow",
"bit-set",
@@ -1646,9 +1646,9 @@ dependencies = [
[[package]]
name = "deno_ops"
-version = "0.134.0"
+version = "0.135.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe122714b90abf065a746f452f69beae37324436a1541118ca4078b9b9d2b260"
+checksum = "5f53a36c6138b760bda9c032ab9251a8f83286da4ef7724de313d1621931263e"
dependencies = [
"proc-macro-rules",
"proc-macro2",
@@ -5408,9 +5408,9 @@ dependencies = [
[[package]]
name = "serde_v8"
-version = "0.167.0"
+version = "0.168.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc6b38f6831f968e3813a480ca5a236c9a0972d9dcf0bb241f193ba524e4cf4e"
+checksum = "a64d740e74bee1f5bc3f4fe49aab63b08ee6dcc606e9321dec71628ba80e4293"
dependencies = [
"bytes",
"derive_more",
diff --git a/Cargo.toml b/Cargo.toml
index 1771ec18b..e081f8c67 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -42,7 +42,7 @@ repository = "https://github.com/denoland/deno"
[workspace.dependencies]
deno_ast = { version = "0.32.0", features = ["transpiling"] }
-deno_core = { version = "0.258.0" }
+deno_core = { version = "0.259.0" }
deno_bench_util = { version = "0.130.0", path = "./bench_util" }
deno_lockfile = "0.18.0"
diff --git a/cli/js/40_test.js b/cli/js/40_test.js
index f18cccd98..b9735fc01 100644
--- a/cli/js/40_test.js
+++ b/cli/js/40_test.js
@@ -172,7 +172,7 @@ function assertOps(fn) {
opIdHostRecvCtrl,
);
}
- const preTraces = new Map(core.opCallTraces);
+ const preTraces = core.getAllOpCallTraces();
let postTraces;
let report = null;
@@ -195,7 +195,7 @@ function assertOps(fn) {
opIdHostRecvCtrl,
);
}
- postTraces = new Map(core.opCallTraces);
+ postTraces = core.getAllOpCallTraces();
if (res === 3) {
report = op_test_op_sanitizer_report(desc.id);
}
diff --git a/cli/tests/unit/ops_test.ts b/cli/tests/unit/ops_test.ts
index 1b7377dc5..ae225c78d 100644
--- a/cli/tests/unit/ops_test.ts
+++ b/cli/tests/unit/ops_test.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-const EXPECTED_OP_COUNT = 49;
+const EXPECTED_OP_COUNT = 45;
Deno.test(function checkExposedOps() {
// @ts-ignore TS doesn't allow to index with symbol
diff --git a/cli/tests/unit/text_encoding_test.ts b/cli/tests/unit/text_encoding_test.ts
index 24dd35aa3..719e5907e 100644
--- a/cli/tests/unit/text_encoding_test.ts
+++ b/cli/tests/unit/text_encoding_test.ts
@@ -270,7 +270,7 @@ Deno.test(function textEncoderShouldCoerceToString() {
Deno.test(function binaryEncode() {
// @ts-ignore: Deno[Deno.internal].core allowed
- const ops = Deno[Deno.internal].core.ops;
+ const core = Deno[Deno.internal].core;
function asBinaryString(bytes: Uint8Array): string {
return Array.from(bytes).map(
(v: number) => String.fromCodePoint(v),
@@ -281,30 +281,6 @@ Deno.test(function binaryEncode() {
const chars: string[] = Array.from(binaryString);
return chars.map((v: string): number | undefined => v.codePointAt(0));
}
-
- // invalid utf-8 code points
- const invalid = new Uint8Array([0xC0]);
- assertEquals(
- ops.op_encode_binary_string(invalid),
- asBinaryString(invalid),
- );
-
- const invalid2 = new Uint8Array([0xC1]);
- assertEquals(
- ops.op_encode_binary_string(invalid2),
- asBinaryString(invalid2),
- );
-
- for (let i = 0, j = 255; i <= 255; i++, j--) {
- const bytes = new Uint8Array([i, j]);
- const binaryString = ops.op_encode_binary_string(bytes);
- assertEquals(
- binaryString,
- asBinaryString(bytes),
- );
- assertEquals(Array.from(bytes), decodeBinary(binaryString));
- }
-
const inputs = [
"σ😀",
"Кириллица is Cyrillic",
@@ -315,7 +291,7 @@ Deno.test(function binaryEncode() {
];
for (const input of inputs) {
const bytes = new TextEncoder().encode(input);
- const binaryString = ops.op_encode_binary_string(bytes);
+ const binaryString = core.encodeBinaryString(bytes);
assertEquals(
binaryString,
asBinaryString(bytes),
diff --git a/cli/tools/test/mod.rs b/cli/tools/test/mod.rs
index 3095e727d..332bfa8c8 100644
--- a/cli/tools/test/mod.rs
+++ b/cli/tools/test/mod.rs
@@ -496,7 +496,7 @@ async fn test_specifier_inner(
if options.trace_ops {
worker.execute_script_static(
located_script_name!(),
- "Deno[Deno.internal].core.enableOpCallTracing();",
+ "Deno[Deno.internal].core.setOpCallTracingEnabled(true);",
)?;
}
diff --git a/ext/fs/30_fs.js b/ext/fs/30_fs.js
index aa7f345e5..46358c42a 100644
--- a/ext/fs/30_fs.js
+++ b/ext/fs/30_fs.js
@@ -4,9 +4,9 @@ import { core, internals, primordials } from "ext:core/mod.js";
const {
isDate,
internalRidSymbol,
+ createCancelHandle,
} = core;
import {
- op_cancel_handle,
op_fs_chdir,
op_fs_chmod_async,
op_fs_chmod_sync,
@@ -823,7 +823,7 @@ async function readFile(path, options) {
let abortHandler;
if (options?.signal) {
options.signal.throwIfAborted();
- cancelRid = op_cancel_handle();
+ cancelRid = createCancelHandle();
abortHandler = () => core.tryClose(cancelRid);
options.signal[abortSignal.add](abortHandler);
}
@@ -853,7 +853,7 @@ async function readTextFile(path, options) {
let abortHandler;
if (options?.signal) {
options.signal.throwIfAborted();
- cancelRid = op_cancel_handle();
+ cancelRid = createCancelHandle();
abortHandler = () => core.tryClose(cancelRid);
options.signal[abortSignal.add](abortHandler);
}
@@ -899,7 +899,7 @@ async function writeFile(
let abortHandler;
if (options.signal) {
options.signal.throwIfAborted();
- cancelRid = op_cancel_handle();
+ cancelRid = createCancelHandle();
abortHandler = () => core.tryClose(cancelRid);
options.signal[abortSignal.add](abortHandler);
}
diff --git a/ext/net/01_net.js b/ext/net/01_net.js
index 1523f5aa5..50f4971f5 100644
--- a/ext/net/01_net.js
+++ b/ext/net/01_net.js
@@ -5,9 +5,9 @@ const {
BadResourcePrototype,
InterruptedPrototype,
internalRidSymbol,
+ createCancelHandle,
} = core;
import {
- op_cancel_handle,
op_dns_resolve,
op_net_accept_tcp,
op_net_accept_unix,
@@ -67,7 +67,7 @@ async function resolveDns(query, recordType, options) {
let abortHandler;
if (options?.signal) {
options.signal.throwIfAborted();
- cancelRid = op_cancel_handle();
+ cancelRid = createCancelHandle();
abortHandler = () => core.tryClose(cancelRid);
options.signal[abortSignal.add](abortHandler);
}
diff --git a/ext/web/lib.rs b/ext/web/lib.rs
index acac78f56..3defbd74e 100644
--- a/ext/web/lib.rs
+++ b/ext/web/lib.rs
@@ -14,7 +14,6 @@ use deno_core::op2;
use deno_core::url::Url;
use deno_core::v8;
use deno_core::ByteString;
-use deno_core::CancelHandle;
use deno_core::OpState;
use deno_core::Resource;
use deno_core::ResourceId;
@@ -71,7 +70,6 @@ deno_core::extension!(deno_web,
op_encoding_new_decoder,
op_encoding_decode,
op_encoding_encode_into,
- op_encode_binary_string,
op_blob_create_part,
op_blob_slice_part,
op_blob_read_part,
@@ -87,7 +85,6 @@ deno_core::extension!(deno_web,
compression::op_compression_finish,
op_now<P>,
op_timer_handle,
- op_cancel_handle,
op_sleep,
op_transfer_arraybuffer,
stream_resource::op_readable_stream_resource_allocate,
@@ -439,19 +436,6 @@ fn op_transfer_arraybuffer<'a>(
Ok(v8::ArrayBuffer::with_backing_store(scope, &bs))
}
-#[op2]
-#[serde]
-fn op_encode_binary_string(#[buffer] s: &[u8]) -> ByteString {
- ByteString::from(s)
-}
-
-/// Creates a [`CancelHandle`] resource that can be used to cancel invocations of certain ops.
-#[op2(fast)]
-#[smi]
-pub fn op_cancel_handle(state: &mut OpState) -> u32 {
- state.resource_table.add(CancelHandle::new())
-}
-
pub fn get_declaration() -> PathBuf {
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("lib.deno_web.d.ts")
}
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index f956db67c..191d123b9 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -622,12 +622,6 @@ const NOT_IMPORTED_OPS = [
// TODO(bartlomieju): used in a regression test, but probably not needed
// anymore if ops are not user accessible.
"op_spawn_child",
-
- // TODO(bartlomieju): can be removed after the `deno_core` upgrade.
- "op_encode_binary_string",
- "op_format_file_name",
- "op_apply_source_map",
- "op_apply_source_map_filename",
];
function removeImportedOps() {