Fix no_module build.

This commit is contained in:
Stephen Chung
2020-10-18 22:10:08 +08:00
parent 46b92c9d1f
commit 6e5c903241
6 changed files with 24 additions and 13 deletions

View File

@@ -12,8 +12,12 @@ mod fn_ptr_functions {
pub fn name(f: &mut FnPtr) -> ImmutableString {
f.get_fn_name().clone()
}
#[rhai_fn(name = "is_anonymous", get = "is_anonymous")]
pub fn is_anonymous(f: &mut FnPtr) -> bool {
f.is_anonymous()
#[cfg(not(feature = "no_function"))]
pub mod anonymous {
#[rhai_fn(name = "is_anonymous", get = "is_anonymous")]
pub fn is_anonymous(f: &mut FnPtr) -> bool {
f.is_anonymous()
}
}
}