Create NativeCallable trait.

This commit is contained in:
Stephen Chung
2020-05-11 13:36:50 +08:00
parent 314ec5e4d2
commit 4a8710a4a9
9 changed files with 115 additions and 80 deletions

View File

@@ -202,6 +202,13 @@ pub struct FnDef {
pub pos: Position,
}
/// A sharable script-defined function.
#[cfg(feature = "sync")]
pub type SharedFnDef = Arc<FnDef>;
/// A sharable script-defined function.
#[cfg(not(feature = "sync"))]
pub type SharedFnDef = Rc<FnDef>;
/// `return`/`throw` statement.
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub enum ReturnType {