Fail with Trap in Instance::new() instead of Error (#683)

This commit is contained in:
Yury Delendik
2019-12-30 16:25:16 -06:00
committed by GitHub
parent 51f3ac0c45
commit 681445b18b
18 changed files with 172 additions and 86 deletions

View File

@@ -147,7 +147,7 @@ impl Func {
self.r#type.results().len()
}
pub fn call(&self, params: &[Val]) -> Result<Box<[Val]>, HostRef<Trap>> {
pub fn call(&self, params: &[Val]) -> Result<Box<[Val]>, Trap> {
let mut results = vec![Val::null(); self.result_arity()];
self.callable.call(params, &mut results)?;
Ok(results.into_boxed_slice())