mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-06-12 06:21:40 +00:00
Rename Initialization error to Instatiation
This commit is contained in:
@ -167,7 +167,7 @@ impl<St> ModuleInstance<St> {
|
||||
.map(|is| is.entries())
|
||||
.unwrap_or(&[]);
|
||||
if imports.len() != extern_vals.len() {
|
||||
return Err(Error::Initialization(format!(
|
||||
return Err(Error::Instatiation(format!(
|
||||
"extern_vals length is not equal to import section entries"
|
||||
)));
|
||||
}
|
||||
@ -181,7 +181,7 @@ impl<St> ModuleInstance<St> {
|
||||
.expect("Due to validation function type should exists");
|
||||
let actual_fn_type = func.func_type();
|
||||
if expected_fn_type != actual_fn_type {
|
||||
return Err(Error::Initialization(format!(
|
||||
return Err(Error::Instatiation(format!(
|
||||
"Expected function with type {:?}, but actual type is {:?} for entry {}",
|
||||
expected_fn_type,
|
||||
actual_fn_type,
|
||||
@ -200,7 +200,7 @@ impl<St> ModuleInstance<St> {
|
||||
}
|
||||
(&External::Global(ref gl), &ExternVal::Global(ref global)) => {
|
||||
if gl.content_type() != global.value_type() {
|
||||
return Err(Error::Initialization(format!(
|
||||
return Err(Error::Instatiation(format!(
|
||||
"Expect global with {:?} type, but provided global with {:?} type",
|
||||
gl.content_type(),
|
||||
global.value_type(),
|
||||
@ -209,7 +209,7 @@ impl<St> ModuleInstance<St> {
|
||||
instance.push_global(Rc::clone(global))
|
||||
}
|
||||
(expected_import, actual_extern_val) => {
|
||||
return Err(Error::Initialization(format!(
|
||||
return Err(Error::Instatiation(format!(
|
||||
"Expected {:?} type, but provided {:?} extern_val",
|
||||
expected_import,
|
||||
actual_extern_val
|
||||
@ -369,7 +369,7 @@ impl<St> ModuleInstance<St> {
|
||||
let module_name = import_entry.module();
|
||||
let field_name = import_entry.field();
|
||||
let resolver = imports.resolver(module_name).ok_or_else(|| {
|
||||
Error::Initialization(format!("Module {} not found", module_name))
|
||||
Error::Instatiation(format!("Module {} not found", module_name))
|
||||
})?;
|
||||
let extern_val = match *import_entry.external() {
|
||||
External::Function(fn_ty_idx) => {
|
||||
@ -600,7 +600,7 @@ fn eval_init_expr<T>(init_expr: &InitExpr, module: &ModuleInstance<T>) -> Runtim
|
||||
|
||||
fn match_limits(l1: &ResizableLimits, l2: &ResizableLimits) -> Result<(), Error> {
|
||||
if l1.initial() < l2.initial() {
|
||||
return Err(Error::Initialization(format!(
|
||||
return Err(Error::Instatiation(format!(
|
||||
"trying to import with limits l1.initial={} and l2.initial={}",
|
||||
l1.initial(),
|
||||
l2.initial()
|
||||
@ -611,7 +611,7 @@ fn match_limits(l1: &ResizableLimits, l2: &ResizableLimits) -> Result<(), Error>
|
||||
(_, None) => (),
|
||||
(Some(m1), Some(m2)) if m1 <= m2 => (),
|
||||
_ => {
|
||||
return Err(Error::Initialization(format!(
|
||||
return Err(Error::Instatiation(format!(
|
||||
"trying to import with limits l1.max={:?} and l2.max={:?}",
|
||||
l1.maximum(),
|
||||
l2.maximum()
|
||||
|
Reference in New Issue
Block a user