diff options
Diffstat (limited to 'core/bindings.rs')
-rw-r--r-- | core/bindings.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/core/bindings.rs b/core/bindings.rs index 46b6c622c..1f35d1246 100644 --- a/core/bindings.rs +++ b/core/bindings.rs @@ -115,15 +115,13 @@ where } pub(crate) fn initialize_context<'s>( - scope: &mut v8::HandleScope<'s, ()>, + scope: &mut v8::HandleScope<'s>, + context: v8::Local<'s, v8::Context>, op_ctxs: &[OpCtx], snapshot_options: SnapshotOptions, ) -> v8::Local<'s, v8::Context> { - let context = v8::Context::new(scope); let global = context.global(scope); - let scope = &mut v8::ContextScope::new(scope, context); - let mut codegen = String::with_capacity(op_ctxs.len() * 200); codegen.push_str(include_str!("bindings.js")); _ = writeln!( @@ -287,7 +285,7 @@ pub fn host_import_module_dynamically_callback<'s>( let resolver_handle = v8::Global::new(scope, resolver); { let state_rc = JsRuntime::state(scope); - let module_map_rc = JsRuntime::module_map(scope); + let module_map_rc = JsRuntime::module_map_from(scope); debug!( "dyn_import specifier {} referrer {} ", @@ -323,7 +321,7 @@ pub extern "C" fn host_initialize_import_meta_object_callback( ) { // SAFETY: `CallbackScope` can be safely constructed from `Local<Context>` let scope = &mut unsafe { v8::CallbackScope::new(context) }; - let module_map_rc = JsRuntime::module_map(scope); + let module_map_rc = JsRuntime::module_map_from(scope); let module_map = module_map_rc.borrow(); let module_global = v8::Global::new(scope, module); @@ -366,7 +364,7 @@ fn import_meta_resolve( let url_prop = args.data(); url_prop.to_rust_string_lossy(scope) }; - let module_map_rc = JsRuntime::module_map(scope); + let module_map_rc = JsRuntime::module_map_from(scope); let loader = module_map_rc.borrow().loader.clone(); let specifier_str = specifier.to_rust_string_lossy(scope); @@ -584,7 +582,7 @@ pub fn module_resolve_callback<'s>( // SAFETY: `CallbackScope` can be safely constructed from `Local<Context>` let scope = &mut unsafe { v8::CallbackScope::new(context) }; - let module_map_rc = JsRuntime::module_map(scope); + let module_map_rc = JsRuntime::module_map_from(scope); let module_map = module_map_rc.borrow(); let referrer_global = v8::Global::new(scope, referrer); |