summaryrefslogtreecommitdiff
path: root/core/bindings.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-10-15 01:53:13 +0200
committerGitHub <noreply@github.com>2022-10-15 01:53:13 +0200
commite7d7585065a70ea388bfccce3681671d25f737b4 (patch)
treecfa58ee57ecdfca80155928a788e5b60ffd61bba /core/bindings.rs
parentafcea6c233dad9b1c3e8202b950d38bf0c472c40 (diff)
chore: upgrade rusty_v8 to 0.53.0 (#16272)
Diffstat (limited to 'core/bindings.rs')
-rw-r--r--core/bindings.rs19
1 files changed, 8 insertions, 11 deletions
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<v8::Context>,
- _host_defined_options: v8::Local<v8::Data>,
- resource_name: v8::Local<v8::Value>,
- specifier: v8::Local<v8::String>,
- import_assertions: v8::Local<v8::FixedArray>,
-) -> *mut v8::Promise {
- // SAFETY: `CallbackScope` can be safely constructed from `Local<Context>`
- 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<v8::Local<'s, v8::Promise>> {
// 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(