Basic Implementation of Plugins and Plugin Functions

This commit is contained in:
jhwgh1968
2020-06-02 21:44:26 -05:00
parent a5d8ce2e49
commit 27b8f9929d
5 changed files with 153 additions and 33 deletions

View File

@@ -1652,6 +1652,7 @@ impl Engine {
let mut scope = Scope::new();
self.call_script_fn(&mut scope, state, lib, name, fn_def, args, *pos, level)
}
Ok(x) if x.is_plugin_fn() => x.get_plugin_fn().call(args.as_mut(), *pos),
Ok(x) => x.get_native_fn()(args.as_mut()).map_err(|err| err.new_position(*pos)),
Err(err)
if def_val.is_some()