diff --git a/Cargo.lock b/Cargo.lock index 4e7382f0fb..b1550a0448 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5347,9 +5347,9 @@ dependencies = [ [[package]] name = "v8" -version = "0.53.1" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e952e936bcb610c9f22997f50dc7f65887afe76e1fedd37daf532a20211335ca" +checksum = "3b63103bd7caa4c3571e8baafe58f3e04818df70505304ed814737e655d1d8d6" dependencies = [ "bitflags", "fslock", diff --git a/core/Cargo.toml b/core/Cargo.toml index 0a1b1208a4..9540157acc 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -34,7 +34,7 @@ serde_json = { version = "1.0.79", features = ["preserve_order"] } serde_v8 = { version = "0.66.0", path = "../serde_v8" } sourcemap = "6.1" url = { version = "2.3.1", features = ["serde", "expose_internals"] } -v8 = { version = "0.53.1", default-features = false } +v8 = { version = "0.54.0", default-features = false } [[example]] name = "http_bench_json_ops" diff --git a/core/bindings.rs b/core/bindings.rs index fdd8abf1ac..a28a3a132b 100644 --- a/core/bindings.rs +++ b/core/bindings.rs @@ -343,7 +343,7 @@ fn import_meta_resolve( } let specifier = maybe_arg_str.unwrap(); let referrer = { - let url_prop = args.data().unwrap(); + let url_prop = args.data(); url_prop.to_rust_string_lossy(scope) }; let module_map_rc = JsRuntime::module_map(scope); diff --git a/ext/ffi/lib.rs b/ext/ffi/lib.rs index 3ad75e245e..3de204ef3f 100644 --- a/ext/ffi/lib.rs +++ b/ext/ffi/lib.rs @@ -706,8 +706,7 @@ fn make_sync_fn<'s>( |scope: &mut v8::HandleScope, args: v8::FunctionCallbackArguments, mut rv: v8::ReturnValue| { - let external: v8::Local = - args.data().unwrap().try_into().unwrap(); + let external: v8::Local = args.data().try_into().unwrap(); // SAFETY: The pointer will not be deallocated until the function is // garbage collected. let symbol = unsafe { &*(external.value() as *const Symbol) }; diff --git a/ext/flash/lib.rs b/ext/flash/lib.rs index 17e3e83178..9cff7d2fc0 100644 --- a/ext/flash/lib.rs +++ b/ext/flash/lib.rs @@ -539,8 +539,7 @@ fn op_flash_make_request<'scope>( |_: &mut v8::HandleScope, args: v8::FunctionCallbackArguments, mut rv: v8::ReturnValue| { - let external: v8::Local = - args.data().unwrap().try_into().unwrap(); + let external: v8::Local = args.data().try_into().unwrap(); // SAFETY: This external is guaranteed to be a pointer to a ServerContext let ctx = unsafe { &mut *(external.value() as *mut ServerContext) }; rv.set_uint32(next_request_sync(ctx)); @@ -561,8 +560,7 @@ fn op_flash_make_request<'scope>( |scope: &mut v8::HandleScope, args: v8::FunctionCallbackArguments, mut rv: v8::ReturnValue| { - let external: v8::Local = - args.data().unwrap().try_into().unwrap(); + let external: v8::Local = args.data().try_into().unwrap(); // SAFETY: This external is guaranteed to be a pointer to a ServerContext let ctx = unsafe { &mut *(external.value() as *mut ServerContext) }; let token = args.get(0).uint32_value(scope).unwrap(); @@ -585,8 +583,7 @@ fn op_flash_make_request<'scope>( |scope: &mut v8::HandleScope, args: v8::FunctionCallbackArguments, mut rv: v8::ReturnValue| { - let external: v8::Local = - args.data().unwrap().try_into().unwrap(); + let external: v8::Local = args.data().try_into().unwrap(); // SAFETY: This external is guaranteed to be a pointer to a ServerContext let ctx = unsafe { &mut *(external.value() as *mut ServerContext) }; diff --git a/ext/napi/function.rs b/ext/napi/function.rs index 853283b086..edeed25663 100644 --- a/ext/napi/function.rs +++ b/ext/napi/function.rs @@ -27,13 +27,12 @@ impl CallbackInfo { } extern "C" fn call_fn(info: *const v8::FunctionCallbackInfo) { - let args = - unsafe { v8::FunctionCallbackArguments::from_function_callback_info(info) }; - let mut rv = unsafe { v8::ReturnValue::from_function_callback_info(info) }; + let info = unsafe { &*info }; + let args = v8::FunctionCallbackArguments::from_function_callback_info(info); + let mut rv = v8::ReturnValue::from_function_callback_info(info); // SAFETY: create_function guarantees that the data is a CallbackInfo external. let info_ptr: *mut CallbackInfo = unsafe { - let external_value = - v8::Local::::cast(args.data().unwrap_unchecked()); + let external_value = v8::Local::::cast(args.data()); external_value.value() as _ }; diff --git a/ops/lib.rs b/ops/lib.rs index adc50e69c6..e8ea1e969c 100644 --- a/ops/lib.rs +++ b/ops/lib.rs @@ -229,7 +229,7 @@ fn codegen_v8_async( use #core::futures::FutureExt; // SAFETY: #core guarantees args.data() is a v8 External pointing to an OpCtx for the isolates lifetime let ctx = unsafe { - &*(#core::v8::Local::<#core::v8::External>::cast(args.data().unwrap_unchecked()).value() + &*(#core::v8::Local::<#core::v8::External>::cast(args.data()).value() as *const #core::_ops::OpCtx) }; let op_id = ctx.id; @@ -557,7 +557,7 @@ fn codegen_v8_sync( quote! { // SAFETY: #core guarantees args.data() is a v8 External pointing to an OpCtx for the isolates lifetime let ctx = unsafe { - &*(#core::v8::Local::<#core::v8::External>::cast(args.data().unwrap_unchecked()).value() + &*(#core::v8::Local::<#core::v8::External>::cast(args.data()).value() as *const #core::_ops::OpCtx) }; diff --git a/serde_v8/Cargo.toml b/serde_v8/Cargo.toml index fd4f1a4c8a..bba333ffb9 100644 --- a/serde_v8/Cargo.toml +++ b/serde_v8/Cargo.toml @@ -18,7 +18,7 @@ derive_more = "0.99.17" serde = { version = "1.0.136", features = ["derive"] } serde_bytes = "0.11" smallvec = { version = "1.8", features = ["union"] } -v8 = { version = "0.53.1", default-features = false } +v8 = { version = "0.54.0", default-features = false } [dev-dependencies] bencher = "0.1"