pub async fn load_module(
    &mut self,
    specifier: &ModuleSpecifier,
    code: Option<String>,
  ) -> Result<ModuleId, AnyError> {
    let module_map_rc = Self::module_map(self.v8_isolate());

    let mut load = module_map_rc
      .borrow()
      .load_main(specifier.as_str(), code)
      .await?;

    while let Some(info_result) = load.next().await {
      let info = info_result?;
      let scope = &mut self.handle_scope();
      module_map_rc
        .borrow_mut()
        .register_during_load(scope, info, &mut load)?;
    }

    let root_id = load.expect_finished();
    self.instantiate_module(root_id)?;
    Ok(root_id)
  }
/// Asynchronously load specified module and all of its dependencies
///
/// User must call `JsRuntime::mod_evaluate` with returned `ModuleId`
/// manually after load is finished.
Asynchronously load specified module and all of its dependencies
User must call `JsRuntime::mod_evaluate` with returned `ModuleId`
manually after load is finished.
Asynchronously load specified module and all of its dependencies User must call ` JsRuntime :: mod_evaluate ` with returned ` ModuleId ` manually after load is finished .
pub async fn load_module(
    &mut self,
    specifier: &ModuleSpecifier,
    code: Option<String>,
  ) -> Result<ModuleId, AnyError> {
    let module_map_rc = Self::module_map(self.v8_isolate());
    let mut load = module_map_rc
      .borrow()
      .load_main(specifier.as_str(), code)
      .await?;
    while let Some(info_result) = load.next().await {
      let info = info_result?;
      let scope = &mut self.handle_scope();
      module_map_rc
        .borrow_mut()
        .register_during_load(scope, info, &mut load)?;
    }
    let root_id = load.expect_finished();
    self.instantiate_module(root_id)?;
    Ok(root_id)
  }
pub async fn load_module ( & mut self , specifier : & ModuleSpecifier , code : Option < String > , ) -> Result < ModuleId , AnyError > { let module_map_rc = Self :: module_map ( self . v8_isolate ( ) ) ; let mut load = module_map_rc . borrow ( ) . load_main ( specifier . as_str ( ) , code ) . await ? ; while let Some ( info_result ) = load . next ( ) . await { let info = info_result ? ; let scope = & mut self . handle_scope ( ) ; module_map_rc . borrow_mut ( ) . register_during_load ( scope , info , & mut load ) ? ; } let root_id = load . expect_finished ( ) ; self . instantiate_module ( root_id ) ? ; Ok ( root_id ) }
Asynchronously load specified module and all of its dependencies
User must call `JsRuntime::mod_evaluate` with returned `ModuleId`
manually after load is finished.
Asynchronously load specified module and all of its dependencies User must call ` JsRuntime :: mod_evaluate ` with returned ` ModuleId ` manually after load is finished .
&mut self
specifier
&ModuleSpecifier
code
Option<String>
&mut self
specifier
&ModuleSpecifier
code
Option<String>