Search for global variables in global modules.

This commit is contained in:
Stephen Chung
2022-03-27 21:49:34 +08:00
parent 2b10c33b81
commit 5caf20d26b
4 changed files with 25 additions and 9 deletions

View File

@@ -85,6 +85,8 @@ fn test_plugins_package() -> Result<(), Box<EvalAltResult>> {
reg_functions!(engine += greet::single(INT, bool, char));
assert_eq!(engine.eval::<INT>("MYSTIC_NUMBER")?, 42);
#[cfg(not(feature = "no_object"))]
{
assert_eq!(engine.eval::<INT>("let a = [1, 2, 3]; a.foo")?, 1);