Naive short circuiting implementation for user panics and results. (#167)

* Add panic and result catching

* exit process on panic and user runtime error

* Complete initial implementation
This commit is contained in:
Lachlan Sneff
2019-02-08 13:08:03 -08:00
committed by GitHub
parent 4e1bc483a8
commit 1886b3d3c1
10 changed files with 171 additions and 60 deletions

View File

@ -82,6 +82,12 @@ pub trait ProtectedCaller: Send + Sync {
vmctx: *mut vm::Ctx,
_: Token,
) -> RuntimeResult<Vec<Value>>;
fn get_early_trapper(&self) -> Box<dyn UserTrapper>;
}
pub trait UserTrapper {
unsafe fn do_early_trap(&self, msg: String) -> !;
}
pub trait FuncResolver: Send + Sync {