From e7d7585065a70ea388bfccce3681671d25f737b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 15 Oct 2022 01:53:13 +0200 Subject: chore: upgrade rusty_v8 to 0.53.0 (#16272) --- core/bindings.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'core/bindings.rs') diff --git a/core/bindings.rs b/core/bindings.rs index 52ecf7bac..fdd8abf1a 100644 --- a/core/bindings.rs +++ b/core/bindings.rs @@ -228,16 +228,13 @@ pub extern "C" fn wasm_async_resolve_promise_callback( } } -pub extern "C" fn host_import_module_dynamically_callback( - context: v8::Local, - _host_defined_options: v8::Local, - resource_name: v8::Local, - specifier: v8::Local, - import_assertions: v8::Local, -) -> *mut v8::Promise { - // SAFETY: `CallbackScope` can be safely constructed from `Local` - let scope = &mut unsafe { v8::CallbackScope::new(context) }; - +pub fn host_import_module_dynamically_callback<'s>( + scope: &mut v8::HandleScope<'s>, + _host_defined_options: v8::Local<'s, v8::Data>, + resource_name: v8::Local<'s, v8::Value>, + specifier: v8::Local<'s, v8::String>, + import_assertions: v8::Local<'s, v8::FixedArray>, +) -> Option> { // NOTE(bartlomieju): will crash for non-UTF-8 specifier let specifier_str = specifier .to_string(scope) @@ -298,7 +295,7 @@ pub extern "C" fn host_import_module_dynamically_callback( let promise = promise.catch(scope, map_err).unwrap(); - &*promise as *const _ as *mut _ + Some(promise) } pub extern "C" fn host_initialize_import_meta_object_callback( -- cgit v1.2.3