From 381932ce1e79f38bbf8bdf28b4e808038aead7a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 30 Nov 2022 23:20:18 +0100 Subject: [PATCH] chore: upgrade rusty_v8 to 0.58.0 (#16879) --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- cli/napi/js_native_api.rs | 5 ++--- core/ops_builtin_v8.rs | 2 +- ext/web/lib.rs | 2 +- serde_v8/magic/detached_buffer.rs | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 809dbd3fba..0ee45a9f2b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5388,9 +5388,9 @@ dependencies = [ [[package]] name = "v8" -version = "0.57.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "293cb302608e408948274638627411722c394926a975923a5ca2ec573ed7132e" +checksum = "8e9b88668afedf6ec9f8f6d30b446f622498da2ef0b3991a52e10f0ea8c6cc09" dependencies = [ "bitflags", "fslock", diff --git a/Cargo.toml b/Cargo.toml index 831f1b9600..2bd754d474 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,7 @@ license = "MIT" repository = "https://github.com/denoland/deno" [workspace.dependencies] -v8 = { version = "0.57.0", default-features = false } +v8 = { version = "0.58.0", default-features = false } deno_ast = { version = "0.21.0", features = ["transpiling"] } deno_core = { version = "0.161.0", path = "./core" } diff --git a/cli/napi/js_native_api.rs b/cli/napi/js_native_api.rs index a0605af11c..a4726fd39a 100644 --- a/cli/napi/js_native_api.rs +++ b/cli/napi/js_native_api.rs @@ -1260,11 +1260,10 @@ fn napi_delete_reference(env: *mut Env, _nref: napi_ref) -> Result { } #[napi_sym::napi_sym] -fn napi_detach_arraybuffer(env: *mut Env, value: napi_value) -> Result { - let env: &mut Env = env.as_mut().ok_or(Error::InvalidArg)?; +fn napi_detach_arraybuffer(_env: *mut Env, value: napi_value) -> Result { let value = transmute::>(value); let ab = v8::Local::::try_from(value).unwrap(); - ab.detach(v8::undefined(&mut env.scope()).into()); + ab.detach(None); Ok(()) } diff --git a/core/ops_builtin_v8.rs b/core/ops_builtin_v8.rs index c72e114bd5..cfbb3eba48 100644 --- a/core/ops_builtin_v8.rs +++ b/core/ops_builtin_v8.rs @@ -472,7 +472,7 @@ fn op_serialize( } let backing_store = buf.get_backing_store(); - buf.detach(v8::undefined(scope).into()); + buf.detach(None); let id = shared_array_buffer_store.insert(backing_store); value_serializer.transfer_array_buffer(id, buf); let id = v8::Number::new(scope, id as f64).into(); diff --git a/ext/web/lib.rs b/ext/web/lib.rs index 85fae2c64b..cfbcee6e3d 100644 --- a/ext/web/lib.rs +++ b/ext/web/lib.rs @@ -383,7 +383,7 @@ fn op_transfer_arraybuffer<'a>( return Err(type_error("ArrayBuffer is not detachable")); } let bs = ab.get_backing_store(); - ab.detach(v8::undefined(scope).into()); + ab.detach(None); let ab = v8::ArrayBuffer::with_backing_store(scope, &bs); Ok(serde_v8::Value { v8_value: ab.into(), diff --git a/serde_v8/magic/detached_buffer.rs b/serde_v8/magic/detached_buffer.rs index 78232cbe77..cbe8b39c39 100644 --- a/serde_v8/magic/detached_buffer.rs +++ b/serde_v8/magic/detached_buffer.rs @@ -63,7 +63,7 @@ impl FromV8 for DetachedBuffer { return Err(crate::Error::ExpectedDetachable); } let store = b.get_backing_store(); - b.detach(v8::undefined(scope).into()); // Detach + b.detach(None); // Detach Ok(Self(V8Slice { store, range })) } }