Add public_only parameter to module function methods.

This commit is contained in:
Stephen Chung
2020-07-27 18:10:45 +08:00
parent a3a167424b
commit 057f6435a4
8 changed files with 87 additions and 100 deletions

View File

@@ -35,7 +35,7 @@ fn test_module_sub_module() -> Result<(), Box<EvalAltResult>> {
let m2 = m.get_sub_module("universe").unwrap();
assert!(m2.contains_var("answer"));
assert!(m2.contains_fn(hash_inc));
assert!(m2.contains_fn(hash_inc, false));
assert_eq!(m2.get_var_value::<INT>("answer").unwrap(), 41);

View File

@@ -1,11 +1,14 @@
#![cfg(not(feature = "no_std"))]
#![cfg(not(target_arch = "wasm32"))]
use rhai::{Engine, EvalAltResult, INT};
use rhai::{Engine, EvalAltResult};
#[cfg(not(feature = "no_float"))]
use rhai::FLOAT;
#[cfg(feature = "no_float")]
use rhai::INT;
#[test]
fn test_timestamp() -> Result<(), Box<EvalAltResult>> {
let engine = Engine::new();