Engine::register_global_module and Engine::register_static_module must be passed shared Module.

This commit is contained in:
Stephen Chung
2020-12-23 10:08:43 +08:00
parent 15fb03218c
commit f55a56c6bc
11 changed files with 23 additions and 22 deletions

View File

@@ -62,7 +62,7 @@ fn test_functions_namespaces() -> Result<(), Box<EvalAltResult>> {
let hash = m.set_fn_0("test", || Ok(999 as INT));
m.update_fn_namespace(hash, FnNamespace::Global);
engine.register_static_module("hello", m);
engine.register_static_module("hello", m.into());
assert_eq!(engine.eval::<INT>("test()")?, 999);
assert_eq!(engine.eval::<INT>("fn test() { 123 } test()")?, 123);