mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-06-21 18:51:52 +00:00
Clean.
This commit is contained in:
@ -3,7 +3,6 @@ use std::collections::HashMap;
|
||||
use parking_lot::RwLock;
|
||||
use elements::Module;
|
||||
use interpreter::Error;
|
||||
use interpreter::emscripten::{self, env_module};
|
||||
use interpreter::module::{ModuleInstance, ModuleInstanceInterface};
|
||||
|
||||
/// Program instance. Program is a set of instantiated modules.
|
||||
@ -26,17 +25,6 @@ impl ProgramInstance {
|
||||
}
|
||||
}
|
||||
|
||||
/// Create new program instance with added Emscripten's `env` module.
|
||||
///
|
||||
/// You can specify desired environment params. Or you can just pass `Default::default()`.
|
||||
pub fn with_emscripten_env(params: emscripten::EnvParams) -> Result<Self, Error> {
|
||||
let instance = ProgramInstance {
|
||||
essence: Arc::new(ProgramInstanceEssence::new()),
|
||||
};
|
||||
// instance.essence.modules.write().insert("env".into(), env_module(params)?);
|
||||
Ok(instance)
|
||||
}
|
||||
|
||||
/// Instantiate module with validation.
|
||||
pub fn add_module<'a>(&self, name: &str, module: Module, externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface + 'a>>>) -> Result<Arc<ModuleInstance>, Error> {
|
||||
let mut module_instance = ModuleInstance::new(Arc::downgrade(&self.essence), name.into(), module)?;
|
||||
|
Reference in New Issue
Block a user